Skip to content

Instantly share code, notes, and snippets.

@ryanb
ryanb / github_tree_slider.js
Created December 6, 2010 17:23
This is how GitHub's new AJAX file browser works.
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
@chrismatthieu
chrismatthieu / gist:964754
Created May 10, 2011 15:58
SIP Registrar with Tropo PSTN
// Run Redis - cd redis-2.2.4 and run src/redis-server
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
var tropoapi = require('tropo-webapi');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
@melvynhills
melvynhills / gist:1153858
Created August 18, 2011 11:14
Method types in CoffeeScript
class Foo
privateMethod = ->
console.log "privateMethod"
publicMethod: ->
console.log "publicMethod"
privateMethod()
@staticMethod: ->
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@ahomu
ahomu / doctest.coffee
Created September 2, 2012 10:09
.coffee documentation comment sample for YUIDoc
###*
# hogehoge test description
# @class Hoge
###
class Hoge
###*
# fuga is number
# @property {Number} fuga
###
@fuga
@GerHobbelt
GerHobbelt / .gitignore
Created September 7, 2012 20:44
d3.js: using layout.force to plot tree graphs (where nodes may have multiple parents) - Part 1: pure tree
# Editor backup files
*.bak
*~
@giuliandrimba
giuliandrimba / namespace.js
Created December 6, 2012 01:45
JavaScript: namespace helper
function namespace(name)
{
var namespaces = name.split(".");
var name = "";
function getName(parent)
{
if(namespaces.length > 0)
{
name = namespaces.shift();
@0thernet
0thernet / README.md
Last active July 3, 2023 14:07
Force Editor + Pan/Zoom

Drag from an existing node to add a new node or link. Click to select/deselect nodes/links. Hit the DELETE key to remove the selected node or link. Drag to pan. Scroll to zoom.

Built with D3.js.

@santiycr
santiycr / sauce_connect_setup.sh
Last active December 14, 2015 19:49
A small bash script to download and start Sauce Connect as part of a Travis Build.
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
@everzet
everzet / sauce_connect_setup.sh
Last active December 18, 2015 00:39
Non-verbose SauceLabs connect setup for Travis
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script: