Skip to content

Instantly share code, notes, and snippets.

View bryanbibat's full-sized avatar

Bryan Bibat bryanbibat

View GitHub Profile
deck = []
13.times { deck << 0 }
39.times { deck << 1 }
result = Hash.new(0)
1000000.times do
deck = deck.shuffle
count = 0
@bryanbibat
bryanbibat / wishlist-2017.md
Last active December 6, 2017 22:36
Xmas 2017 secret santa
  • At least P500 worth of Oral-B Electric Toothbrush replacement heads, available at Mercury Drug or Watsons. Can be the following:

  • BM-800 condenser microphone. Available at Lazada. If you're feeling generous, you can add a desktop mic stand, but not a suspension boom/arm stand or a floor stand.

  • Water resistant cellphone armband for Galaxy S7 or larger

@bryanbibat
bryanbibat / application.html.erb
Last active August 29, 2015 13:59
Bootstrap First App
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>First App</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
@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
@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 / 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 / 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 / .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 / 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 / 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'