This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
stat = status | |
ci = commit | |
co = checkout | |
br = branch | |
ls = ls-files | |
undo = reset --soft HEAD^ | |
merge = merge --no-commit | |
cdiff = diff --cached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express() | |
app.use(function (req, res, next) { | |
res.writeHead(401, "Unauthorized", | |
{ 'Content-Type': 'application/json', | |
'www-authenticate': 'Basic realm="My Realm"' }); | |
res.end('{"error":[401,"Unauthorized"]}'); | |
console.log('401 refused ' + new Date() + ' (' + (new Date).getTime() + ')'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// playing with the bar example from https://github.com/ericelliott/stampit | |
// added a concept of specials | |
'use strict'; | |
var stampit = require('stampit'); | |
// Some more privileged methods, with some private data. | |
// Use stampit.mixin() to make this feel declarative: | |
var availability = stampit().init(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// original: https://gist.github.com/chrishulbert/895382 | |
var dgram = require('dgram'); // dgram is UDP | |
var matcher = process.argv[2] ? new RegExp(process.argv[2]) : undefined; | |
function search() { | |
var client = dgram.createSocket("udp4"); | |
client.bind(); | |
client.once('listening', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist | |
# defaults write com.apple.dashboard mcx-disabled -boolean true | |
export GRADLE_OPTS="-Xms1024m -Xmx2048m" | |
export JAVA_OPTS="-Xms1024m -Xmx2048m" | |
export ANDROID_HOME=/usr/local/opt/android-sdk | |
export BUILD_MAC_SDK_EXPERIMENTAL=1 | |
export USE_CCACHE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
tell application "Audio Hijack Pro" | |
try | |
set miniaturized of windows to true -- most apps | |
end try | |
start hijacking (first session whose name is "System") | |
end tell | |
return input | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import android.graphics.Bitmap.Config; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.graphics.Shader; | |
// enables hardware accelerated rounded corners | |
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.SuppressLint; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.webkit.WebChromeClient; | |
import android.webkit.WebSettings; | |
import android.webkit.WebView; | |
import android.webkit.WebViewClient; | |
public class MainActivity extends Activity { | |
private WebView webview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var speak = require("node-speak") | |
, airtunes = require('airtunes') | |
, Buffer = require('buffer').Buffer | |
, spawn = require('child_process').spawn | |
, streamBuffers = require("stream-buffers") | |
, argv = require('optimist') | |
.usage('Usage: $0 --host [host] --port [num] --ffmpeg [path] --words [string] --volume [num] --password [string]') | |
.default('port', 5000) | |
.default('volume', 50) | |
.default('ffmpeg', '/usr/local/bin/ffmpeg') |
NewerOlder