Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile
@jagtesh
jagtesh / yosemite-bluetooth-fix.sh
Last active August 29, 2015 14:15 — forked from tyilo/yosemite-bluetooth-fix.sh
Updated it for use with brew
#!/bin/bash
# Install sleepwatcher
sudo cp /usr/local/Cellar/sleepwatcher/2.2/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents/
sudo cp /usr/local/Cellar/sleepwatcher/2.2/etc/sleepwatcher/rc.* /etc/c
# Add bluetooth script to /etc/rc.wakeup (the script requires root)
sudo tee -a /etc/rc.wakeup <<EOF
kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport && sleep 3 && kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
EOF
'use strict';
var q = require('q');
/**
* Constructs a function that proxies to promiseFactory
* limiting the count of promises that can run simultaneously.
* @param promiseFactory function that returns promises.
* @param limit how many promises are allowed to be running at the same time.
* @returns function that returns a promise that eventually proxies to promiseFactory.

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jagtesh
jagtesh / split_tunneling.md
Created May 7, 2013 09:06
Split Tunneling tutorial - with openconnect (tested, works with Cisco AnyConnect VPN) Source: http://lists.unix-ag.uni-kl.de/pipermail/vpnc-devel/2009-February/002990.html

Table of Contents

  1. DISCLAIMER 2. Status 3. Introduction 4. Security issues 5. DNS
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@jagtesh
jagtesh / Inconsolata-dz-Powerline.otf
Created December 10, 2012 11:44 — forked from qrush/Inconsolata-dz-Powerline.otf
vim-powerline patched fonts
@jagtesh
jagtesh / .vimrc
Created November 9, 2012 07:00
Vim Power Config
set expandtab
set autoindent
set shiftwidth=4
set softtabstop=4
set number
@jagtesh
jagtesh / .tmux.conf
Created November 9, 2012 06:59
My Tmux Power Config (Mouse friendly)
# Sets Ctrl-A as the default modifier key (same as screen, habitually used to it)
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Enables pane selection using the mouse, even in xterm
set -g mouse-select-pane on
# Pane scrolling using the mouse wheel
setw -g mode-mouse on