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
import sys | |
import csv | |
# import time | |
import re | |
from typing import Iterator | |
from datetime import datetime, timezone, timedelta | |
# Mango Baby format |
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
// This is where the individual donation data will live. | |
// This does not have a state or error key because this is not where the loading happens. | |
donations: { | |
1: { | |
// When an action is performed which involves an api call we keep a track of the request here. | |
// This allows us to show that the action is in progress. And if the user navigates away from the current page then back, it will still be in progress. | |
actions: { | |
refunding: { | |
request: <request object>, | |
errorMessage: "" |
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
rsync -av --delete-after --safe-links source/ dest |
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
var responsive = function(configs) { | |
var current_config = null; | |
var $window = $(window); | |
$window.resize(function(event) { | |
var width = $window.width(); | |
$(configs).each(function() { |
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
times = [] | |
def Timed (times) | |
Thread.new { | |
start = Time.now | |
yield | |
times.push(Time.now - start) | |
} | |
end |
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($){ | |
window.User = Backbone.Model.extend({ | |
urlRoot: 'users' | |
}); | |
window.UserView = Backbone.View.extend({ | |
tagName: 'li', | |
initialize: function(){ | |
_.bindAll(this, 'render', 'unrender', 'remove'); |
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
//NSString *path = [[self bundle] pathForResource:@"dino" ofType:@"tiff"]; | |
NSString *path = [[self bundle] pathForResource:@"a" ofType:@"gif"]; | |
NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; |
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: | |
// http://www.informit.com/blogs/blog.aspx?uk=Ask-Big-Nerd-Ranch-Blocks-in-Objective-C#footnote1 | |
// example accepting block as parameter | |
- (NSArray *)mapUsingBlock:(id (^)(id obj))block | |
{ | |
NSMutableArray *output = [NSMutableArray array]; | |
for (id obj in self) | |
[output addObject:block(obj)]; |