This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
global_var = "This is a globally scoped variable"; | |
console.log(global_var); | |
return { | |
data: "example" | |
} | |
})() | |
console.log(global_var); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM quirky/rails | |
RUN mkdir /opt/app | |
WORKDIR /opt/app | |
ADD ./Gemfile /opt/app/Gemfile | |
ADD ./Gemfile.lock /opt/app/Gemfile.lock | |
RUN bundle install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import getopt | |
from decimal import Decimal | |
import csv | |
import locale | |
from subprocess import call | |
# Set the locale for currency formatting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -T | |
# | |
# Lists members of all groups, or optionally just the group | |
# specified on the command line | |
# | |
# Copyright © 2010-2013 by Zed Pobre ([email protected] or [email protected]) | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/ | |
# | |
# | |
# | |
# | |
# | |
# Source function library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_hasBeenSetup = False | |
def setup(): | |
global _hasBeenSetup | |
if _hasBeenSetup: | |
return | |
_hasBeenSetup = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Best 2 | |
// Use of IoC is relegated only to the calling class. | |
// Injection of dependency is through an instance variable rather than through the constructor | |
public class UserService | |
{ | |
public virtual User GetUserByID(long userID) | |
{ | |
//Get user from database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IDictionary<string, object> ToDictionary(this object values) | |
{ | |
var dict = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); | |
if (values != null) | |
{ | |
foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(values)) | |
{ | |
object obj = propertyDescriptor.GetValue(values); | |
dict.Add(propertyDescriptor.Name, obj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["coffee", "-c", "$file"], | |
"selector": "source.coffee", | |
"path": "/usr/local/bin" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH+=/usr/local/bin | |
#list all and colorize | |
alias ls='ls -Ga' | |
#fix for gitk | |
alias gitk='gitk 2>/dev/null' | |
#list files only | |
alias lf='ls -l | grep -v ^d' |