Skip to content

Instantly share code, notes, and snippets.

View jxmot's full-sized avatar

J.Motyl jxmot

View GitHub Profile
@RobertAKARobin
RobertAKARobin / safari.md
Last active December 5, 2024 01:38
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@jxmot
jxmot / ip_isvalid.php
Last active February 19, 2022 22:25
IP Address Validator - PHP & JSON
<?php
/*
ip_isvalid() - Checks an IP address against a list of
valid IP addresses.
Params:
$_ip - can be `null` or an IP address. If `null`
then `REMADDR` will be checked.
Returns: An object, where `r` is either `true` (the
@av01d
av01d / ColorSteps.js
Last active February 27, 2024 15:42
Javascript calculate color steps (gradient) between two colors
const ColorSteps = (() => {
/**
* Convert any color string to an [r,g,b,a] array.
* @author Arjan Haverkamp (arjan-at-avoid-dot-org)
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)'
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color.
* @see https://gist.github.com/av01d/8f068dd43447b475dec4aad0a6107288
*/
const colorValues = color => {
@quisido
quisido / htmlspecialchars.js
Created August 3, 2018 17:30
PHP's htmlspecialchars implemented in JavaScript
// Create the function.
var htmlspecialchars = function(string) {
// Our finalized string will start out as a copy of the initial string.
var escapedString = string;
// For each of the special characters,
var len = htmlspecialchars.specialchars.length;
for (var x = 0; x < len; x++) {
@jxmot
jxmot / show_wifi_clients.md
Created May 7, 2018 15:28
Tessel 2 & OpenWRT - Show AP WiFi Clients

Tessel 2 & OpenWRT - Show AP WiFi Clients

The show_wifi_clients.sh shell script found here is a modified version of what I found at the OpenWRT Wireless FAQ.

My intent is to use it on a Tessel 2 along with some modifications its firmware. The firmware mods (not shown here) will exec the script to obtain a JSON formatted list of stations that are attached to the Tessel's access point.

The differences are -

  • Can optionally create output in JSON
    • Includes the time stamp found in the DHCP lease file
  • Minor changes made to expressions
@obahareth
obahareth / README.md
Created June 11, 2017 10:29
GitHub GraphQL API Starred Repositories With Pagination

GitHub GraphQL API Starred Repositories Examples With Pagination

You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.

The first example gets your first 3 starred repos, the cursor values can be used for pagination.

Here's an example response from the first query:

{
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active April 21, 2025 08:59
Detect new network devices connecting to OpenWrt and send text message
@zakirt
zakirt / animated-gif-detect.js
Last active January 12, 2025 22:31
Detecting if GIF file is animated using JavaScript
/**
* @author Zakir Tariverdiev
* @class animatedGifDetect
* @description
* GIF file reader that checks whether GIF image is animated, or not.
* Uses information gathered from the website below:
* http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp
*/
(function(window, undefined) {
'use strict';
@erikgall
erikgall / rsync.md
Last active January 21, 2025 11:20
Sync a local folder with a remote folder over SSH using rsync

The command -- rsync

rsync

rsync **source/** **destination
@MattKetmo
MattKetmo / pwnd.md
Last active February 12, 2025 17:51
pwnd

This list has moved to pwnd.dev

Tools

  • Metaspoit: Penetration testing software
  • GhostShell: Malware indetectable, with AV bypass techniques, anti-disassembly, etc.
  • BeEF: The Browser Exploitation Framework
  • PTF: Penetration Testers Framework
  • Bettercap: MITM framework
  • Nessus: Vulnerability scanner