(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
from __future__ import print_function | |
import time | |
print_func = print | |
def format_sec(milliseconds): | |
return '{:>8.3f} sec.'.format(milliseconds / 1000.0) | |
current_milli_time = lambda: int(round(time.time() * 1000)) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
''' | |
Created on Mar 10, 2014 | |
@author: jimhorng | |
''' | |
from apns import APNs, Payload | |
import time | |
import logging | |
import sys |
#!/bin/zsh | |
# | |
# Highlight a given file and copy it as RTF. | |
# | |
# Simon Olofsson <[email protected]> | |
# | |
set -o errexit | |
set -o nounset |
if (downloadRatio < 1.0) { | |
self.debug.log("Download ratio is poor."); | |
if (current > 0) { | |
self.debug.log("We are not at the lowest bitrate, so switch down."); | |
self.manifestExt.getRepresentationFor(current - 1, data).then( | |
function (representation1) { | |
self.manifestExt.getBandwidth(representation1).then( | |
function (oneDownBandwidth) { | |
self.manifestExt.getRepresentationFor(current, data).then( | |
function (representation2) { |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Integer, Column | |
from postgresql_json import JSON | |
Base = declarative_base() | |
class Document(Base): | |
id = Column(Integer(), primary_key=True) | |
data = Column(JSON) | |
#do whatever other work |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |