Skip to content

Instantly share code, notes, and snippets.

View zishe's full-sized avatar
🏠
Working from home

Alexander Kireev zishe

🏠
Working from home
  • Ko Pha Ngan, Thailand
View GitHub Profile
@nicalpi
nicalpi / facebook_registration.rb
Created September 7, 2011 11:48
Testing Omniauth with Devise, Rspec and Capybara
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


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
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
@malandrina
malandrina / gist:3744867
Created September 18, 2012 18:26
Implementing a Reverse Polish Notation Calculator in Ruby

Implementing a Reverse Polish notation calculator in Ruby

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
@5HT
5HT / WebFrameworks.md
Last active January 26, 2021 07:19
Overview of Web Frameworks (2013)
@jakemmarsh
jakemmarsh / controllers.js
Last active May 20, 2019 10:15
AngularJS Service with Controller for access to Google API with Javascript Client (and RequireJS)
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);
@headius
headius / 1. results
Last active April 27, 2016 19:43
mandelbrot performance across JRuby 9k modes
# 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
@Lawondyss
Lawondyss / AngularJS FlashMessage
Last active January 2, 2016 21:49
Uses CSS framework SemanticUI.
myApp = angular.module 'myApp', []
myApp.service 'FlashMessage', ($rootScope) ->
Flash = () ->
$rootScope.flashes = []
$rootScope.$on '$routeChangeSuccess', () ->
$rootScope.$broadcast 'FlashMessage:reset', $rootScope.flashes = []
return
@zishe
zishe / diff
Last active August 29, 2015 13:58
Ruby frameworks bench
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