As configured in my dotfiles.
start new:
tmux
start new with session name:
set :rails_env, :production | |
set :unicorn_binary, "/usr/bin/unicorn" | |
set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do |
#!/usr/bin/env ruby | |
# Libraries::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
require 'rubygems' | |
require 'sinatra/base' | |
require 'slim' | |
require 'sass' | |
require 'coffee-script' | |
# Application::::::::::::::::::::::::::::::::::::::::::::::::::: |
public class MyLibrary { | |
public static final String XMLNS = "http://mylib.com/schema" | |
} | |
// in widget class | |
public class MyWidget { | |
public MyWidget(Context context, AttributeSet attrs) { | |
// don't use obtainStyledAttributes, but getAttributeResourceValue: | |
int myAttr = attrs.getAttributeResourceValue(MyLibrary.XMLNS, "myAttr", -1); |
# ... | |
gem 'carrierwave' | |
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL |
As configured in my dotfiles.
start new:
tmux
start new with session name:
/* This implementation does DCT-II on iOS, using the iOS vDSP FFT methods. Supposedly this is faster than in plain C (i.e. FFTW), but I didn't do any tests to support this claim. For one thing, as far as I understand it, doing DCT takes less clock cycles than FFT, and using this code we do an FFT of size 2N for a DCT of size N (and then some post processing. Anyone is welcome to comment :) | |
This code was developed using the following 2 sources, and I owe great gratitude to their authors: http://developer.apple.com/library/ios/#documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html and http://www.hydrogenaudio.org/forums//lofiversion/index.php/t39574.html | |
I don't claim I understand everything I do, but the thing is, it works -- as in, it gives me the same result as jtransform with scaling on :) And it's fast enough for my use: on the iPhone 4S I can get 320 DCTs of length 2048 per second. Perhaps I can improve this with some further tweaking (although I' |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Video recording demo</title> | |
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div class="container"> |
-export([graceful_stop/1, graceful_stop_proc/1]). | |
graceful_stop(Timeout) -> | |
lists:foreach(fun stop_listener/1, supervisor:which_children(cowboy_sup)), | |
proc_lib:spawn(?MODULE, graceful_stop_proc, [Timeout]). | |
graceful_stop_proc(Timeout) -> | |
true = register(graceful_stop, self()), | |
lager:critical("SHUTDOWN with timeout of ~p msec", [Timeout]), | |
TRef = erlang:start_timer(Timeout, self(), not_so_graceful), |
// For details, see http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill | |
#import <AssetsLibrary/AssetsLibrary.h> | |
#import <ImageIO/ImageIO.h> | |
// Helper methods for thumbnailForAsset:maxPixelSize: | |
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) { | |
ALAssetRepresentation *rep = (__bridge id)info; | |
NSError *error = nil; |
# If your Chef version is earlier than 11.0.0, use version 1.10.0 of this cookbook: https://github.com/opscode-cookbooks/apt/commit/dd29a85257161ff42c9595627dd370b02be2060f | |
vagrant halt | |
cd cookbooks/apt | |
git reset --hard 1.10.0 | |
vagrant up |