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:
| #!/usr/bin/env ruby | |
| require 'benchmark' | |
| Benchmark.bm do |b| | |
| n = 1_000_000 | |
| hash1 = {a: 1, b: 2, c: 3} | |
| hash2 = {x: 1, y: 2, z: 3} |
| //To run Q.js examples: | |
| // 1. Open a new browser tab in Chrome and turn on developer toolbar. | |
| // 2. Copy/Paste this gist in the console and hit enter to run all the snippets. | |
| // Based on the inspiration from samples @ https://github.com/kriskowal/q | |
| //////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////// |
| { | |
| "app/adapters/*.js": { | |
| "command": "adapter", | |
| "template": [ | |
| "// export default DS.{capitalize}Adapter.extend();", | |
| ] | |
| }, | |
| "app/components/*.js": { | |
| "command": "component", |
| // new: accepts an optional transformer as first argument | |
| // str.template({key:value}); | |
| // or | |
| // str.template(htmlEscaper, {key:value}); | |
| String.prototype.template = function (fn, object) { | |
| // Andrea Giammarchi - WTFPL License | |
| var | |
| hasTransformer = typeof fn === 'function', | |
| prefix = hasTransformer ? '__tpl' + (+new Date) : '', | |
| stringify = JSON.stringify, |
| The MIT License (MIT) | |
| Copyright (c) 2015 Justin Perry | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| this software and associated documentation files (the "Software"), to deal in | |
| the Software without restriction, including without limitation the rights to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, | |
| subject to the following conditions: |
| babel github-es6.js -o github.js --optional runtime --experimental |
According to libuv folks, the most reliable way to do asynchronous file I/O is blocking read(2) in a threadpool. Although Windows has IO Completion Ports, they fall down in enough cases they are largely not used. Regardless, we want to support read(2)-in-a-threadpool models, so this section assumes files are a good instantiation of that model, and analyzes how readable byte streams work in that case.
Given a file readable byte stream with a known size, read the entire thing into memory:
async function file_exact(fileRBS, knownFileSize) {| using UnityEngine; | |
| using System.Collections; | |
| using System; | |
| using System.Security.Policy; | |
| using System.Threading; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; | |
| using WebSocketSharp; | |
| using WebSocketSharp.Net; |
| // app/initializers/froala-semantic-icons.js | |
| import Ember from 'ember'; | |
| export function initialize() { | |
| // https://www.froala.com/wysiwyg-editor/docs/concepts/custom-icon | |
| Ember.$.FroalaEditor.ICON_DEFAULT_TEMPLATE = 'semantic_ui'; | |
| Ember.$.FroalaEditor.DefineIconTemplate( 'semantic_ui', '<i class="[NAME] icon"></i>'); | |
| Ember.$.FroalaEditor.DefineIcon( 'color' , { NAME: 'theme' } ); // tint | |
| Ember.$.FroalaEditor.DefineIcon( 'undo' , { NAME: 'undo' } ); // rotate-left | |
| Ember.$.FroalaEditor.DefineIcon( 'redo' , { NAME: 'repeat' } ); // rotate-right |