Skip to content

Instantly share code, notes, and snippets.

@andrewschaaf
andrewschaaf / gist:cedcab72bdefef2126d5
Last active August 29, 2015 14:06
ffmpeg: using a stream of concatenated PPMs

concatenated PPMs → MP4

...ppms... | ffmpeg \
  -f image2pipe \
  -c ppm \
  -r 60 \                 # 60 fps
  -i - \
  -b:v 10M \              # 10 Mbit/s
 -s 1440x900 \ # resize to 1440x900
@andrewschaaf
andrewschaaf / 1-setup.txt
Created February 12, 2012 22:29
Cassandra notes
sudo apt-get install -y openjdk-6-jdk
wget http://apache.tradebit.com/pub//cassandra/1.0.7/apache-cassandra-1.0.7-bin.tar.gz
openssl sha1 apache-cassandra-1.0.7-bin.tar.gz
# SHA1(apache-cassandra-1.0.7-bin.tar.gz)= 8ae535821b29eead5b7dc7788a0e66ecf1ac267e
tar xzf apache-cassandra-1.0.7-bin.tar.gz
rm apache-cassandra-1.0.7-bin.tar.gz
mv apache-cassandra-1.0.7 cassandra
cassandra/conf/cassandra.yaml
RandomPartitioner -> ByteOrderedPartitioner
Ah, Ruby community...
Y U no like rigorous implementation like the Python community?
ruby-1.9.2-head :001 > require 'multi_json'
=> true
ruby-1.9.2-head :002 > MultiJson.decode "{}"
=> {}
ruby-1.9.2-head :003 > MultiJson.decode "1"
module.exports = (app) ->
r = app.redis
db = app.db
app.get '/', (req, res, next) ->
res.render 'index'
app.get '/foo', (req, res, next) ->
res.render 'foo'
fs = require 'fs'
{spawn, exec} = require 'child_process'
closureCompile = (mode, srcPath, destPath, callback = (->)) ->
modeArgs = {
pretty: ['--compilation_level', 'WHITESPACE_ONLY',
'--formatting', 'PRETTY_PRINT'],
simple: ['--compilation_level', 'SIMPLE_OPTIMIZATIONS'],
ubuntu@bo:~/rubygems-1.3.4$ sudo ruby setup.rb
Installing RubyGems
Installing gem executable
Removing old source_cache files
Removing old RubyGems RDoc and ri
Installing rubygems-1.3.4 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-1.3.4/ri
./lib/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from ./lib/rubygems/custom_require.rb:31:in `require'
from ./lib/rubygems/commands/setup_command.rb:342:in `run_rdoc'
from ./lib/rubygems/commands/setup_command.rb:237:in `install_rdoc'
function appendText(text) {
var div = document.createElement('div');
div.appendChild(document.createTextNode("*************"));
document.body.appendChild(div);
}
x = """..."..."..."..."""
console.log JSON.stringify x
# "...\"...\"...\"..."
http://www.facebook.com/pages/Bitcoin-for-Magento-Shopping-cart-plugin/121206584627332
http://forum.bitcoin.org/?topic=1966.0
net = require 'net'
hexy = require 'hexy'
server = net.createServer (c) ->
c.on 'data', (data) ->
console.log '------ got data: ------'
console.log hexy.hexy data