This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
// Copyright (c) Alliedstrand Corporation. All rights reserved. | |
// | |
// Licensed under the MIT License. | |
'use strict'; | |
/** | |
* @file Extract the GitHub Personal Access Token for GitHub Package Registry | |
* access. | |
* |
''' | |
parse SavedState artifacts extracted from OSX. | |
author: Willi Ballenthin (william.ballenthin@fireeye.com) | |
license: Apache 2.0 | |
''' | |
import re | |
import sys | |
import json | |
import struct |
// I want to do something like this: | |
export default class Foo extends React.Component { | |
render() { | |
return <div ref={div => this._div = div}>I want a reference to this!</div> | |
} | |
} | |
// Flow says: "Property _div not found on Foo" | |
// Is there a way to give Foo the type Component & {_div?: Component} ? |
#!/usr/bin/env node | |
const glob = require('glob'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const mkdirp = require('mkdirp'); | |
const args = global.process.argv.slice(2); | |
const sourcesRoot = args.shift() || path.join(__dirname, '..', 'src'); | |
const specsRoot = args.shift() || path.join(__dirname, '..', 'spec'); |
var Firebase = require('firebase'); | |
var async = require('async'); | |
// Extract data from the kinesis event | |
exports.handler = function(event, context) { | |
// This function abstracts the expected structure of any Kinesis payload, | |
// which is a base64-encoded string of a JSON object, passing the data to | |
// a private function. | |
function handlePayload(record, callback) { |
# spec/support/poltergeist_screenshot_helper.rb | |
module PoltergeistScreenshotHelper | |
# FROM http://blog.jerodsanto.net/2012/12/capybara-and-poltergeist-snap/ | |
def snap!(options={}) | |
path = options.fetch :path, "~/.Trash" | |
file = options.fetch :file, "#{Time.now.to_i}.png" | |
full = options.fetch :full, true | |
path = File.expand_path path |
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def compile script, options | |
script = script.read if script.respond_to?(:read) |
/* | |
* sanitize HTML with jQuery based on whitelist | |
* example: | |
* sanitizer.sanitize('<a href="foo" class="bar">aaa</a><script>alert("...")</script>', {'a': ['href'], 'strong': []}) | |
* returns '<a href="foo">aaa</a>' | |
*/ | |
var sanitizer = {}; | |
(function($) { | |
function trimAttributes(node, allowedAttrs) { |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |