most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
background do | |
set_omniauth() | |
click_link_or_button 'Sign up with Facebook' | |
end |
upstream myapp { | |
server unix:///myapp/tmp/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name myapp.com; | |
# ~2 seconds is often enough for most folks to parse HTML/CSS and | |
# retrieve needed images/icons/frames, connections are cheap in |
A couple weeks ago I had a go at implementing an RPN calculator in Ruby. I knew I wanted the calculator to function by popping operands out of an array populated with the values of the input expression, operating upon the operands with the appropriate operator, and pushing the result back into the stack of operands.
I was able to implement this in version 1, but it took forever and the resulting code was not very beautiful. Why?
I started coding before I had a thorough understanding of RPN
Wait, 20 10 5 4 + * -
is what now?
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/ | |
git clone git://github.com/wbond/sublime_package_control.git Package\ Control | |
cd Package\ Control | |
git checkout python3 | |
# restart Sublime Text 3 and you should have Package Control working |
Framework | Link | Star | Fork | Templating |
---|---|---|---|---|
Python: Flask, | https://github.com/mitsuhiko/flask | 6887 | 1422 | jinja |
Ruby: Sinatra, | https://github.com/sinatra/sinatra | 5097 | 792 |
define(['angular', 'services'], function (angular) { | |
'use strict'; | |
return angular.module('myApp.controllers', ['myApp.services']) | |
.controller('IndexCtrl', ['$scope', 'googleService', function ($scope, googleService) { | |
$scope.login = function () { | |
googleService.login().then(function (data) { | |
// do something with returned data | |
console.log(data.email); |
# interpreted AST | |
system ~/projects/jruby $ jruby.bash -X-C mandelbrot.rb 20 | |
warming up | |
running mandelbrot(500) for 20 iterations | |
4.862 | |
4.822 | |
4.822 | |
4.846 | |
5.057 |
myApp = angular.module 'myApp', [] | |
myApp.service 'FlashMessage', ($rootScope) -> | |
Flash = () -> | |
$rootScope.flashes = [] | |
$rootScope.$on '$routeChangeSuccess', () -> | |
$rootScope.$broadcast 'FlashMessage:reset', $rootScope.flashes = [] | |
return |
jruby-1.7.12 | |
puma -e production -t 100:100 <framework>.ru | |
wrk -t4 -c100 -d2s http://0.0.0.0:9292/ | |
Ruby | |
Rack: 17800.91 | |
Hobbit: 15742.50 | |
Cuba: 14828.45 | |
JRuby + Rack + Torqbox ~ 60k req/s |