Skip to content

Instantly share code, notes, and snippets.

MK kohenkatz

  • Silver Spring, MD
Block or report user

Report or block kohenkatz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kohenkatz
kohenkatz / script.js
Created May 16, 2019
UserScript to widen the Site Switcher dropdown in the Ubiquiti Unifi Controller
View script.js
// ==UserScript==
// @name Widen Unifi Site Switcher
// @namespace http://tampermonkey.net/
// @version 0.1
// @description The Unifi Site Switcher defaults to 200px. We want it wider!
// @author Moshe Katz
// @match https://your.unifi.controller.domain/*
// @grant none
// ==/UserScript==
@kohenkatz
kohenkatz / phpcs.xml
Created Aug 8, 2018
PHPCS config for a Laravel project that uses tabs
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>PHP_CodeSniffer Standards</description>
<file>.</file>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
@kohenkatz
kohenkatz / check_dns_dig.go
Created Jun 14, 2018
A nagios `check_dns` alternative that uses dig instead of nslookup
View check_dns_dig.go
package main
import (
"bytes"
"fmt"
"os"
"os/exec"
"sort"
"strconv"
"strings"
@kohenkatz
kohenkatz / _README.md
Last active May 18, 2018
"PostBin" is a simple server that logs all requests to files in TEMP. Partially based on https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
View _README.md

How to run

php -S 0.0.0.0:3001 postbin.php
@kohenkatz
kohenkatz / _README.md
Created Apr 27, 2018
Git Flow introduction
View _README.md

How to set up git-flow

Installation - if using git on the command line

Linux

wget https://raw.githubusercontent.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh
sudo bash gitflow-installer.sh install stable
rm gitflow-installer.sh
@kohenkatz
kohenkatz / dslreports.scpt
Last active Nov 9, 2017
Mojo Wifi Testing
View dslreports.scpt
tell application "Safari"
-- if it is running then
-- quit
-- delay 5
-- end if
activate
open location "http://www.dslreports.com/speedtest"
delay 1
activate
@kohenkatz
kohenkatz / helpers.js
Created Oct 22, 2017
Cookie Clicker "Helpers"
View helpers.js
function makeCookie() {
Game.shimmerTypes.golden.time = Game.shimmerTypes.golden.maxTime;
}
function clickVisibleCookies() {
Game.shimmers.forEach(function(item) {
if (item.type === 'golden') {
item.l.click();
}
});
View RouteServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
View comcast-test.py
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@kohenkatz
kohenkatz / systemd-spawn-fcgi.sh
Last active Aug 28, 2017 — forked from stbuehler/systemd-spawn-fcgi.sh
How to run a FastCGI process as a service under Systemd, based on http://redmine.lighttpd.net/projects/spawn-fcgi/wiki/Systemd/2
View systemd-spawn-fcgi.sh
#!/bin/bash
set -e
if [ "${LISTEN_PID}" != $$ ]; then
echo >&2 "file descriptors not for us, pid not matching: '${LISTEN_PID}' != '$$'"
exit 255
fi
if [ "${LISTEN_FDS}" != "1" ]; then
You can’t perform that action at this time.