Skip to content

Instantly share code, notes, and snippets.

View mjohnson9's full-sized avatar

Mike Johnson mjohnson9

View GitHub Profile
@mjohnson9
mjohnson9 / ch.py
Created November 3, 2012 19:54
Python Chatango
################################################################
# File: ch.py
# Title: Chatango Library
# Author: Lumirayz/Lumz <lumirayz@gmail.com>
# Version: 1.31
# Description:
# An event-based library for connecting to one or multiple Chatango rooms, has
# support for several things including: messaging, message font,
# name color, deleting, banning, recent history, 2 userlist modes,
# flagging, avoiding flood bans, detecting flags.
package app
import (
"bytes"
"net/http"
"appengine"
"appengine/datastore"
)
@mjohnson9
mjohnson9 / dscp-designer.go
Last active March 1, 2016 04:35
QoS designer for RouterOS devices
package main
import (
"bytes"
"flag"
"fmt"
"io"
"os"
"strconv"
"strings"
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@mjohnson9
mjohnson9 / client.js
Last active August 29, 2015 14:23
Speed test
var timerFunc;
if(window.performance) {
timerFunc = performance.now.bind(performance);
} else {
timerFunc = Date.now.bind(Date);
}
if(window.xhr) { xhr.abort(); }
xhr = new XMLHttpRequest();
xhr.responseType = "blob";
@mjohnson9
mjohnson9 / linter.coffee
Created October 10, 2015 17:18
Systems United Navy: Roster Linter
###
Roster Linter
Created by Michael "NightExcessive" Johnson
Released under the MIT License
###
PublicCache = CacheService.getPublicCache()
class StringUtil
@isAlphanumeric: (char) ->
#!/bin/bash
(echo "Program Source Destination"; (netstat -lantp | grep ESTABLISHED | awk '{print $7" "$4" "$5}' | sort -u)) | column -t
local ffi = require("ffi")
local pcre = ffi.load("pcre")
ffi.cdef([[
typedef struct real_pcre pcre;
typedef struct pcre_extra pcre_extra;
typedef const char * PCRE_SPTR;
static const int PCRE_STUDY_JIT_COMPILE = 0x0001;
@mjohnson9
mjohnson9 / syslog-to-journal.go
Last active October 25, 2015 15:49
A trivial syslog-to-journal implementation
package main
import (
"fmt"
"io"
"net/http"
"time"
"github.com/jeromer/syslogparser"
package main
import (
cryptorand "crypto/rand"
"fmt"
"image"
"image/color"
"image/png"
"math/big"
"math/rand"