Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile

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:

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)"
'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.
@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

Ace editor component for Ember.

  • A two-way binding is set up between value and the text in the editor.
  • Configure Ace in the aceInit callback.

Template

{{ace-editor value=value aceInit=aceInit class="editor"}}
@jagtesh
jagtesh / gist:67e8935f11e413e3b45d
Last active August 29, 2015 14:22 — forked from aaronpowell/gist:9085724
Added the ability to use multiple modules in one file
let module = macro {
case {_
$name
import $params (,) ...
} => {
letstx $name_str = [makeValue(unwrapSyntax(#{$name}), #{here})];
return #{
angular.module($name_str, [$params (,) ...])
};
}
@jagtesh
jagtesh / mergepdf
Created June 16, 2015 00:24
High quality pdf merge with Ghostscript
#!/bin/bash
OUT=$1
shift
# Usage: ./mergepdf OUTPUT file1 file2 file3 ...
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$OUT $@
@jagtesh
jagtesh / uninstall_fusion.sh
Created June 25, 2015 20:32
Uninstall / Remove VMware Fusion from OS X
#!/bin/bash
sudo rm -Rf /Applications/VMware\ Fusion.app
sudo rm -Rf /Library/Application\ Support/VMware
sudo rm -Rf /Library/Application\ Support/VMware\ Fusion
sudo rm -Rf /Library/Preferences/VMware\ Fusion
rm -Rf ~/Library/Application\ Support/VMware\ Fusion
rm -Rf ~/Library/Caches/com.vmware.fusion
rm -Rf ~/Library/Preferences/com.vmware.fusion*
// START //
struct node {
node *left;
node *right;
int val;
};
// Mirrors the tree and returns the root node. The root should be passes as *node.
node* mirror_tree(struct node* node) {
struct node* temp;

Useful Google Wave Gadgets

Whiteboard

Project management