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:
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param {number} r The red color value | |
* @param {number} g The green color value | |
* @param {number} b The blue color value | |
* @return {array} The HSL representation |
static BOOL PSPDFIsDevelopmentBuild(void) { | |
#if TARGET_IPHONE_SIMULATOR | |
return YES; | |
#else | |
static BOOL isDevelopment = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// There is no provisioning profile in AppStore Apps. | |
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
if (data) { |
github.com/twotwotwo/sorts is a Go package with parallel radix- and quicksorts. It can run up to 5x faster than stdlib sort on the right kind of large sort task, so it could be useful for analysis and indexing/database-y work in which you have to sort millions of items. (To be clear, I don't recommend most folks drop stdlib sort, which is great, and which sorts depends on.)
While the process of writing it's fresh on my mind, here are some technical details, some things that didn't make the cut, and some thoughts about the process:
Concretely, what this looks like inside:
Both number and string versions are in-place MSD radix sorts that look at a byte at a time and, once the range being sorted gets down to 128 items, call (essentially) the stdlib's quicksort.
The [parallelization code
// An IRC bot for the k5 programming language, | |
// using oK from : https://github.com/JohnEarnest/ok | |
"use strict"; | |
var irc = require('irc'); | |
var ok = require('./ok/ok'); | |
const MAXLINES = 8; | |
var client = new irc.Client('irc.freenode.net', 'oK-bot', { | |
channels: ['#jsoftware', '#learnprogramming'] |
{ | |
"Apple Bitpool Max (editable)" = 80; | |
"Apple Bitpool Min (editable)" = 35; | |
"Apple Initial Bitpool (editable)" = 35; | |
"Apple Initial Bitpool Min (editable)" = 53; | |
"Negotiated Bitpool" = 80; | |
"Negotiated Bitpool Max" = 80; | |
"Negotiated Bitpool Min" = 80; | |
} |
// I've needed a constexpr way to get a size of the bit fields in struct (i.e. number of bits). | |
// Also, I needed it to work in Visual Studio 2015 (SP3), which is not yet fully support C++14, | |
// so constexpr functions could only use a single return statement and (almost) nothing more. | |
// After some time I've come up with this solution. It should work with any C++11 compiler. | |
// It has some limitations (it only works with unsigned fields). | |
// P.S.: With C++17 it could be done easier by using constexpr lambda expressions in macro. | |
#include <iostream> | |
#include <array> | |
// Helper constexpr functions |
Thought experiment:
Which k primitives can be implemented as k-strings, reasonably efficiently, with a handful of 'native' built-ins?
Not verified to be in dependency order yet... may depend on the choice of 'fundamental' primitives. Need to do speed tests too.
k9 syntax (download via Shakti). Got a better way to write one? Feel free to comment, you'll be credited!