Skip to content

Instantly share code, notes, and snippets.

View Basic-Powershell-Profile.ps1
function Edit-Profile {
code $profile.CurrentUserAllHosts
}
function Edit-GitConfig {
code $HOME/.gitconfig
}
Function Touch-File
{
View gist:490790ad49931498f45a

Remote branch

git push origin master:refs/heads/next
git co --track origin/next

Start new feature

git co -b newfeat

View MicroEvent.js
var MicroEvent = function(){};
MicroEvent.prototype = {
bind : function(event, fct){
this._events = this._events || {};
this._events[event] = this._events[event] || [];
this._events[event].push(fct);
},
once: function(event, fct){
var wrapped = function() {
this.unbind(event, fct);
View ourl.js
var ourl = (function () {
function ourl(url) {
url = url || window.location.href;
return new ObjectifiedUrl(url);
};
ourl.parse = parseUrl;
@rudylattae
rudylattae / npm-debug.log
Created Nov 4, 2013
Log output of failed attempt to install grunt-contrib-testem
View npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'grunt-contrib-testem' ]
2 info using npm@1.3.11
3 info using node@v0.10.21
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 warn package.json borked@0.0.1 No repository field.
6 warn package.json borked@0.0.1 No README data
View polychrome.sh
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 profile_name"
exit 1
fi
PROFILE_NAME="$1"
GOOGLE_CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
USER_DIR="/Users/$USER/Library/Application Support/Google/Chrome/${PROFILE_NAME}"
exec "$GOOGLE_CHROME" \
View Bunch.js
var Bunch = (function () {
// internals
var defaults = {
IDENTITY_FIELD: 'id',
SEQUENCE_START: 0,
hasIdentity: function hasIdentity( item ) {
return item[ this._identityField ];
},
ensureIdentity: function ensureIdentity( item ) {
@rudylattae
rudylattae / story.json
Created Nov 21, 2012
Example of a BlankStage story
View story.json
{
"version": "1.0",
"title": "A dirt simple example of a BlankStage story",
"summary": "This really is nothing but a collection of links as chapters. A proper story would most likely take you through some chapters that have a linear (or user-directed) set of actions.",
"synopsis": "",
"copyright": "Copyright © 2012 Me/You/Who?",
"license": "DRMed -- OMG!!!",
"chapters": [
{
"title": "This is chapter 1.",
View index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src=""></script>
</head>
<body>
<div>
<p>Hello</p>
View tips.py
# DRY for os.path.join
import os
j = lambda filename: os.path.join('/my/base/path', filename)