Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@jacklynrose
jacklynrose / motion-kit-love.rb
Created December 18, 2014 10:31
I do love motion-kit
class ProfileLayout < MotionKit::Layout
def layout
add UIImageView, :profile_image
add UILabel, :name_label
add UILabel, :bio_label
background_color UIColor.whiteColor
end
def profile_image_style
@cevaris
cevaris / rvm_init.sh
Last active August 29, 2015 14:19
RVM project init script which creates the appropriate .ruby-version .ruby-gemset files
#!/usr/bin/env zsh
# or #!/usr/bin/env bash
function rvm_init(){
RVM_VERSION=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
RVM_GEMSET=$(basename $(PWD))
for i in "$@"
do
@Codcore
Codcore / gist:0c7a331b69eed542fb78
Last active August 29, 2015 14:22
Amethyst web framework benchmark

Here are result of Amethyst benchmarking with wrk:

./wrk -d 60 -t 10 -c 200 http://127.0.0.1:8080/
Running 1m test @ http://127.0.0.1:8080/
  10 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.24ms  548.04us  16.95ms   85.04%
    Req/Sec     3.83k   223.66     4.42k    82.93%
  2290956 requests in 1.00m, 9.71GB read
Requests/sec: 38157.50
@priyank-gupta
priyank-gupta / commands
Last active August 29, 2015 14:23
Mina Example Script using Roles (in whenever) as used in Capistrano
# Custom file for whenever.rb with roles, https://gist.github.com/priyank-gupta/e15b5dab570e54cde2ee
# to deploy on staging_1
mina deploy on=staging_1
# to update whenever on staging_2
mina whenever:update on=staging_2
# to restart delayed_job on staging_2
mina delayed_job:restart on=staging_2
@pepe
pepe / my-gh-issues.rb
Created May 9, 2011 07:11 — forked from copiousfreetime/my-gh-issues.rb
My Github Issues
#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
@ariera
ariera / README.markdown
Created August 11, 2011 09:41
A keyboard shortcut to run tests with watchr

A keyboard shortcut to run tests with watchr

When developing in rails I use watchr to run the tests each time a file is saved, but lots of times I find my self adding a whitespace or a newline and saving just to trigger watchr and run the tests.

I wanted to have is a simple keyboard shortcut (like F15) to tell watchr to run the last spec, and mpartel (thx! : ) gave me an idea on how to do it, so here it is:

Dependencies

Obviously you need watchr, but we're also going to need pgrep that will help us find out the pid of the watchr process. So go ahead and do

sudo port install proctools

@argent-smith
argent-smith / how-to.markdown
Created August 17, 2011 10:21
ruby 1.9.2 installation WITH ICONV under rvm and FreeBSD

Ruby 1.9.2 RVM w/iconv FreeBSD installation HOWTO

The Problem

Recently, trying to run some of my crutches (the Ruby thingies I use to help me sysadmining) under RVM, I've found that require 'iconv' doesn't work. Since I knew it's working in standard lang/ruby18 and lang/ruby19 ports I started to search where is the trap and have found that. Here's how.

Prerequisites

  • rvm installed
  • system ruby installed
@martincik
martincik / gist:1183042
Created August 31, 2011 07:59
MBank.cz - Transactions harvester
require 'nokogiri'
require 'open-uri'
require 'mechanize'
require 'logger'
class MBankHarvester
URL = "https://cz.mbank.eu/"
def initialize(login, password, logfile = nil)
@RonJeffries
RonJeffries / payroll playground 1
Last active October 14, 2015 16:39
A Swift Playground for payroll. I have my reasons ...
// Swift playground experimenting with payroll.
// (I have my reasons.)
println("Hello")
import Foundation
// This stuff sets rounding to two places after decimal
var mode = NSRoundingMode.RoundPlain
anonymous
anonymous / shared.rb
Created December 20, 2012 01:51
Shared Juno store Implement your own key value server in 50 lines!
require 'drb'
module Juno
class Shared < Base
def initialize(options = {}, &block)
options[:port] ||= 9000
@uri = options[:uri] || (options[:socket] ? "drbunix://#{options[:socket]}" :
"druby