Skip to content

Instantly share code, notes, and snippets.

@rudylattae
rudylattae / Basic-Powershell-Profile.ps1
Last active February 16, 2020 02:18
Powershell Profile
function Edit-Profile {
code $profile.CurrentUserAllHosts
}
function Edit-GitConfig {
code $HOME/.gitconfig
}
Function Touch-File
{
@rudylattae
rudylattae / gist:490790ad49931498f45a
Last active August 29, 2015 14:06
Git workflow - 1

Remote branch

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

Start new feature

git co -b newfeat

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);
var ourl = (function () {
function ourl(url) {
url = url || window.location.href;
return new ObjectifiedUrl(url);
};
ourl.parse = parseUrl;
@rudylattae
rudylattae / npm-debug.log
Created November 4, 2013 16:25
Log output of failed attempt to install grunt-contrib-testem
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
@rudylattae
rudylattae / polychrome.sh
Created November 24, 2012 20:57
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" \
@rudylattae
rudylattae / Bunch.js
Created November 24, 2012 03:16
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 November 21, 2012 04:49
Example of a BlankStage story
{
"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.",
@rudylattae
rudylattae / index.html
Created October 21, 2012 05:56
html5 - hello
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src=""></script>
</head>
<body>
<div>
<p>Hello</p>
@rudylattae
rudylattae / tips.py
Created November 29, 2011 06:48
Python tips
# DRY for os.path.join
import os
j = lambda filename: os.path.join('/my/base/path', filename)