Skip to content

Instantly share code, notes, and snippets.

View RunsFor's full-sized avatar
🎯

Ilya Konyukhov RunsFor

🎯
View GitHub Profile
@RunsFor
RunsFor / commit-msg.example
Last active August 15, 2016 09:48
Git commit hook to extract issue id from the branch name and prefix commit message with it
#!/bin/bash
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [ $BRANCH_NAME != '(no branch)' ]
then
# создаем временный файл
tempname="ticket-id-XXXX";
tempfile=`mktemp $tempname`;
@RunsFor
RunsFor / define_singleton_method_jruby.rb
Last active February 1, 2016 22:04
jruby perform too slow comparing to mri
require 'benchmark'
objects = nil
puts(Benchmark.measure do
objects = 100_000.times.map { Object.new }
block = proc { nil }
objects.each { |obj| obj.define_singleton_method(:test_me, &block) }
end)
@RunsFor
RunsFor / multithreaded.rb
Last active February 1, 2016 22:28
Multithreaded script performs slower than singlethreaded
require 'benchmark'
puts(Benchmark.measure do
count = 0
400_000_000.times do
count += 1
end
end)
puts(Benchmark.measure do
@RunsFor
RunsFor / install.sh
Last active August 29, 2015 14:17 — forked from sletix/install.sh
#!/usr/bin/env bash
#
# Install latest ruby from brightbox with gems
#
# tested on precise version, and brightbox ruby-1.9.1 package ready for:
# precise(12.04)
#
# run this script on your ubuntu ~>
# `https://gist.githubusercontent.com/RunsFor/7af723f4dea1b73cfce9/raw | sudo bash`
#
[79] pry(main)> time = Time.zone.now
=> Thu, 12 Feb 2015 11:05:54 MSK +03:00
[80] pry(main)> time.to_f
=> 1423728354.07368
[81] pry(main)> user.update_attribute(:updated_at, time)
=> true
[82] pry(main)> user.updated_at.to_f
=> 1423728354.07368
[83] pry(main)> user.reload.updated_at.to_f
=> 1423728354.073
@RunsFor
RunsFor / docker-logstash.conf
Last active August 29, 2015 14:10
logstash configuration for debugging
input { stdin { type => "stdin-type"} }
output { stdout { codec => rubydebug } }
@RunsFor
RunsFor / the_ruby_racer_install.sh
Created March 26, 2014 06:10
Install new version of therubyracer on mac os x
brew tap homebrew/dupes # Thanks Tom
brew install apple-gcc42
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
brew uninstall v8
gem uninstall libv8
@RunsFor
RunsFor / outdated.txt
Created January 20, 2014 14:51
bundle outdated
Outdated gems included in the bundle:
* bootstrap-sass (3.0.3.0 > 2.3.2.2) Gemfile specifies "~> 2.2"
* capistrano (3.1.0 > 2.15.5) Gemfile specifies "~> 2.15.5"
* capybara (2.2.1 > 1.1.4) Gemfile specifies "~> 1.1.3"
* client_side_validations-simple_form (2.1.0 > 2.0.1)
* coffee-rails (4.0.1 > 3.2.2)
* cucumber (1.3.10 > 1.3.6) Gemfile specifies "= 1.3.6"
* devise (3.2.2 > 3.0.4) Gemfile specifies "~> 3.0.2"
* execjs (2.0.2 > 1.4.0) Gemfile specifies "~> 1.4.0"
* faraday (0.9.0 > 0.8.9)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins