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
def make_hash | |
f = File.new("/tmp/intl_users_with_name_and_email") | |
out = open("/tmp/intl_users_json", "w") | |
proxy_emails = 0 | |
blank_names = 0 | |
total = 0 | |
while (line = f.gets) | |
begin |
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
/** | |
* Introducing the $.namespace function! It takes a string and gives you a | |
* global representing the namespace you want. | |
* | |
* For example, $.namespace("Causes.Earn.Dialog") => {Earn: {Dialog: {}}} | |
* | |
* This gets rid of crufty code like: | |
* | |
* if (!Causes) { Causes = {}; } | |
* if (!Causes.Earn) { Causes.Earn = {}; } |
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
# Create our application and namespace. | |
class Alfred extends Batman.App | |
@global yes | |
# setup our root route. When the app starts up, it will automatically call TodosController::index | |
@root 'todos#index' | |
# Define the principal Todo model with `body` and `isDone` attributes, and tell it to persist itself using Local Storage. | |
class Alfred.Todo extends Batman.Model |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test App</title> | |
<script type="text/javascript" src="../lib/es5-shim.js"></script> | |
<script type="text/javascript" src="../lib/batman.js"></script> | |
<script type="text/javascript" src="../lib/batman.solo.js"></script> | |
<script type="text/javascript" src="../lib/coffee-script.js"></script> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Alfred: Batman's Todos</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> | |
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="resources/alfred.css" type="text/css"> | |
<script type="text/javascript" src="../lib/es5-shim.js"></script> |
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
class Shopify.OrdersController extends Shopify.ApplicationController | |
index: (params) -> | |
@allOrders = Shopify.Order.get('all') | |
@_filterOrders() | |
addFilter: (type, value) -> | |
@set "#{type}Filter", value | |
@_filterOrders() | |
_filterOrders: -> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test App</title> | |
<script type="text/javascript" src="../lib/es5-shim.js"></script> | |
<script type="text/javascript" src="../lib/batman.js"></script> | |
<script type="text/javascript" src="../lib/batman.solo.js"></script> | |
<script type="text/javascript" src="../lib/extras/batman.rails.js"></script> | |
<script type="text/javascript" src="../lib/coffee-script.js"></script> | |
</head> |
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
// | |
// NSManagedObject+KTManagedObject.h | |
// Created by Kamil Tusznio on 12-07-10. | |
// | |
#import <CoreData/CoreData.h> | |
@interface NSManagedObject (KTManagedObject) | |
+ (NSArray *)fetchAll; |
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
dollarize = (n, currency = "$", decimals = 2, | |
decimalSeparator = ".", thousandsSeparator = ",") -> | |
if n instanceof String | |
n = parseInt n, 10 | |
sign = if n < 0 then "-" else "" | |
wholeDigits = "" + Math.abs(n - (n % 1)) |
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
%select | |
%option(value="AL") Alabama | |
%option(value="AK") Alaska | |
%option(value="AZ") Arizona | |
%option(value="AR") Arkansas | |
%option(value="CA") California | |
%option(value="CO") Colorado | |
%option(value="CT") Connecticut | |
%option(value="DE") Delaware | |
%option(value="FL") Florida |
OlderNewer