start new:
tmux
start new with session name:
tmux new -s myname
(defmacro once-only ((&rest names) &body body) | |
(let ((gensyms (loop for n in names collect (gensym)))) | |
`(let (,@(loop for g in gensyms collect `(,g (gensym)))) | |
`(let (,,@(loop for g in gensyms for n in names collect ``(,,g ,,n))) | |
,(let (,@(loop for n in names for g in gensyms collect `(,n ,g))) | |
,@body))))) | |
(defmacro do-primes ((var start end) &body body) | |
(once-only (start end) | |
`(do ((,var (next-prime ,start) (next-prime (1+ ,var)))) |
# The trick is to pass timedelta object as a sort key and not to use cmp() function | |
import datetime | |
def date_key(a): | |
""" | |
a: date as string | |
""" | |
a = datetime.datetime.strptime(a, '%d.%m.%Y').date() | |
return a |
From Meteor's documentation:
In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.
This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.
Sometimes we need to run async code in Meteor.methods
. For this we create a Future
to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:
A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.
The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.
What can you say?
{ | |
"libs": ["browser", "underscore", "jquery"], | |
"plugins": { | |
"meteor": {} | |
}, | |
"loadEagerly": ["*.js","*/*.js","*/*/*.js","*/*/*/*.js"], | |
"dontLoad": [".meteor", ".demeteorized"] | |
} |
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() { | |
var lastFireTime:dispatch_time_t = 0 | |
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC)) | |
return { | |
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0) | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, |
void -[UIPopoverPresentationController dimmingViewWasTapped:](void * self, void * _cmd, void * arg2) { | |
esi = self; | |
edi = @selector(delegate); | |
if ([esi delegate] != 0x0) { | |
eax = [esi delegate]; | |
var_10 = @selector(popoverPresentationControllerShouldDismissPopover:); | |
eax = [eax respondsToSelector:@selector(popoverPresentationControllerShouldDismissPopover:)]; | |
if (LOBYTE(eax) != 0x0) { | |
eax = [esi presented]; | |
if (LOBYTE(eax) != 0x0) { |