Skip to content

Instantly share code, notes, and snippets.

View doublerebel's full-sized avatar

Charles Phillips doublerebel

View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@max-mapper
max-mapper / readme.md
Last active August 8, 2016 18:45
simple 4mb buffer proxy benchmarks

simple 4mb buffer proxy benchmarks

the goal: to do fast virtual host routing, e.g. to have a single process on a machine listening on port 80 and proxying data based on HTTP Host to other non-port-80 web processes on the same machine

many people use nginx for this because nginx is faster than node is currently for data-heavy applications (see below)

about these benchmarks

they use the JS proxies from https://github.com/substack/bouncy/tree/master/bench

@lyoshenka
lyoshenka / search-git-history.md
Last active April 1, 2025 07:51
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@gmccullough
gmccullough / titanium-mixpanel.js
Last active February 13, 2017 10:22
This is a little CommonJS library I put together for adding Mixpanel tracking to an iOS and Android Appcelerator Titanium app I built. YMMV. I'm sharing it since I hadn't seen anything similar, and Mixpanel rocks. There are no native dependencies. All Mixpanel API calls are made by using the HTTP specification (https://mixpanel.com/docs/api-docu…
// The currentUser lib stores a model representing the logged in user, and other login state information
var currentUser = require('currentUser');
// Logger is a Ti.API.info() wrapper with a bit more flexibility
var logger = require('logger');
var messageQueue = []; // put this into local storage at some point to retain recent offline events before crashes
var messageInTransit = null;
var token = Ti.App.Properties.getString('mixpanel.token');
var systemProperties = {
mobile_osname: Ti.Platform.osname,
@weilu
weilu / README.md
Last active October 9, 2020 15:55
World Clock widget for dashing

World Clock

screen shot 2013-11-28 at 12 29 37 pm

Description

A simple widget that's capable of displaying time for multiple locations around the world. In our company(neo), we use it to display time in different offices.

Installation

@dylanmcdiarmid
dylanmcdiarmid / iced.js
Created November 19, 2013 15:16
Iced Coffee Script client side usage. This sets `iced` up as a global so your await/defer statements can work in the browser. I ripped this from the server side code, so it may not be entirely correct, but I do have it running and working in production.
window.iced = {
Deferrals: (function() {
__slice = [].slice
function _Class(_arg) {
this.continuation = _arg;
this.count = 1;
this.ret = null;
}
@mattconnolly
mattconnolly / install.sh
Last active April 4, 2016 04:19 — forked from jim80net/install.sh
Pseudo script for installing Jenkins CI on Smart OS. SMF service manifest file included.
#!/bin/pseudo-bash
# Read through this and modify to taste.
# Tested on:
# image_uuid: bad2face-8738-11e2-ac72-0378d02f84de
# smartos base64 1.9.0
#
# jenkins is run as the "admin" user, with its home directory set to /home/admin/jenkins
mkdir ~/jenkins
@codebutler
codebutler / crashlytics_orgs.rb
Last active April 10, 2022 07:32
Crashlytics requires an IDE to "onboard" an Android app for no good reason. This prevents you from setting up a new app using a command line build tools such as Maven, Gradle or unsupported IDEs such as Android Studio. Turns out all you really need is your org's api key, which you can get using this script. Then just add this to your AndroidMani…
require 'httparty'
require 'json'
class Crashlytics
include HTTParty
base_uri 'https://api.crashlytics.com/api/v2'
def session(email, password)
self.class.post('/session.json',
body: {email: email, password:password}.to_json,
@tmcw
tmcw / codemirror_keymap.md
Created May 30, 2013 19:43
CodeMirror keyMap Missing Documentation

An addendum to CodeMirror's keyMap documentation, which unfortunately glosses over the 'connecting the wires' section.

CodeMirror.keyMap.tabSpace = {
    Tab: function(cm) {
        var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
        cm.replaceSelection(spaces, "end", "+input");
    },
    fallthrough: ['basic']
};
@pmuellr
pmuellr / trace-self.js
Created May 23, 2013 02:38
trace JavaScript using v8's --expose-debug-as= option
#!/usr/bin/env node
// run with `node --expose-debug-as=Debug fileName.js`
// traces all the code run after dummyFunc() invoked
// see v8/src/debug-debugger.js for some of the impl of the API
var debug = Debug.Debug
//------------------------------------------------------------------------------