Skip to content

Instantly share code, notes, and snippets.

View bryanbibat's full-sized avatar

Bryan Bibat bryanbibat

View GitHub Profile
@bryanbibat
bryanbibat / meh.txt
Last active October 10, 2015 09:17
ruby from source (ubuntu)
$ sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison subversion
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure
@bryanbibat
bryanbibat / gist:4160851
Created November 28, 2012 12:21
C-cup installation
sudo apt-get install build-essential ruby1.9.1 php5-cli mono-complete mono-vbnc nodejs-legacy openjdk-7-jdk
@bryanbibat
bryanbibat / team_x_prob_a.rb
Created December 3, 2012 15:43
DevCon Code Challenge Cup Solutions
def trunc(x)
(x * 100.0).floor / 100.0
end
output = File.open("bestfit2.txt", "w")
count, point_count, points, = nil, nil, nil
IO.readlines("bestfit.txt").each do |line|
@bryanbibat
bryanbibat / conf.sh
Last active October 13, 2015 16:57
nginx - passenger
# after sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev
./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --add-module='/usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.1/ext/nginx'
@bryanbibat
bryanbibat / upgrading.txt
Created January 18, 2013 17:11
Upgrading Ruby cheatsheet (*nix)
RVM
$ rvm get head
$ rvm upgrade 1.9.3-p362 1.9.3-p374
(if it's not downloading binaries, using an rvm_make_flags like "-j3" can speed things up. see https://rvm.io/workflow/rvmrc/)
rbenv with ruby-build
$ cd ~/.rbenv/plugins/ruby-build
$ git pull
$ rbenv install 1.9.3-p374 MAKE_OPTS="-j3"
$ rbenv rehash
@bryanbibat
bryanbibat / .bash_profile
Created January 22, 2013 09:37
jruby + git branches
export JAVA_OPTS="-client"
COLOR1='\[\e[1;32m\]'
COLOR2='\[\e[1;1m\]'
COLOR3='\[\e[m\]'
GIT_STATUS='$(__git_ps1 " %s")'
PROMPT_CHAR='\$'
PS1="${COLOR1}\u@\h${COLOR3} \w${COLOR2}${GIT_STATUS} ${COLOR3}${PROMPT_CHAR} "
@bryanbibat
bryanbibat / devcon
Last active December 14, 2015 17:49
devcon init.d
#! /bin/bash
# DEVCON
# Maintainer: @bry_bibat
# based on https://raw.github.com/gitlabhq/gitlab-recipes/4-2-stable/init.d/gitlab
### BEGIN INIT INFO
# Provides: devcon
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
@bryanbibat
bryanbibat / 1.9.3.txt
Created April 20, 2013 11:51
Ruby 1.9.3 vs Tweaked specs_helper.rb + Ruby 2.0
19:43:29 - INFO - Guard uses Libnotify to send notifications.
19:43:29 - INFO - Guard uses TerminalTitle to send notifications.
19:43:30 - INFO - Bundle already up-to-date
19:43:30 - INFO - Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
@bryanbibat
bryanbibat / bundler.sh
Created May 8, 2013 02:51
how capistrano runs bundler
bundle install --gemfile /home/deploy/apps/devcon/releases/20130508024349/Gemfile --path /home/deploy/apps/devcon/shared/bundle --deployment --quiet --without development test
@bryanbibat
bryanbibat / ar.rb
Last active August 29, 2015 13:57
joining
@companies = Company.includes(:users).all
@companies.each do |company|
company.users.each do |user|
"#{company.name} #{user.name}"
end
end