Skip to content

Instantly share code, notes, and snippets.

@kohenkatz
kohenkatz / _README.md
Last active May 18, 2018 19:40
"PostBin" is a simple server that logs all requests to files in TEMP. Partially based on https://gist.github.com/magnetikonline/650e30e485c0f91f2f40

How to run

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

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 November 9, 2017 19:21
Mojo Wifi Testing
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 October 22, 2017 21:47
Cookie Clicker "Helpers"
function makeCookie() {
Game.shimmerTypes.golden.time = Game.shimmerTypes.golden.maxTime;
}
function clickVisibleCookies() {
Game.shimmers.forEach(function(item) {
if (item.type === 'golden') {
item.l.click();
}
});
@kohenkatz
kohenkatz / systemd-spawn-fcgi.sh
Last active August 28, 2017 20:03 — 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
#!/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
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@kohenkatz
kohenkatz / lsof.py
Created June 3, 2014 02:38
lsof utility wrapper copied from http://www.remix.net/blog/?p=130
#!/usr/bin/python
from subprocess import Popen, PIPE
import re
class lsof():
"""
lsof wrapper class
An automated wrapper around lsof output that yields
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
@kohenkatz
kohenkatz / EchoServer.groovy
Created August 13, 2013 03:04
"Simple" Multi-threaded Echo server example in Groovy.
public class SimpleEchoServer implements Runnable {
private int port;
private LinkedList<Socket> openClients = new LinkedList<Socket>();
private boolean cleaningUp = false;
public SimpleEchoServer(int port) {
this.port = port;
}
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'