# List available rubies, to choose which ruby to use
$ rvm list rubies
# To install new ruby use, for example version '2.4.1'
$ rvm install 2.4.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extended python -m http.serve with --username and --password parameters for | |
# basic auth, based on https://gist.github.com/fxsjy/5465353 | |
from functools import partial | |
from http.server import SimpleHTTPRequestHandler, test | |
import base64 | |
import os | |
class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
1- Create a new google_bigquery_table
Terraform will perform the following actions:
# google_bigquery_dataset.test_us_bigquery_dataset will be created
+ resource "google_bigquery_dataset" "test_us_bigquery_dataset" {
+ creation_time = (known after apply)
+ dataset_id = "test_schema_update_dataset"
+ etag = (known after apply)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -i | |
cd | |
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y | |
sudo apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config | |
wget http://www.imagemagick.org/download/ImageMagick.tar.gz | |
tar xf ImageMagick.tar.gz | |
cd ImageMagick-6.9.2-8/ | |
./configure --prefix=/opt/imagemagick-6.9 | |
make | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
require 'net/http' | |
Net::HTTP.module_eval do | |
alias_method '__initialize__', 'initialize' | |
def initialize(*args,&block) | |
__initialize__(*args, &block) |
After I installed the fantastic better_errors gem, I was disappointed to notice that linking to your text editor doesn't work correctly on Ubuntu (at least, it didn't for me). Here's how I fixed it.
First, create a new desktop entry:
# /usr/share/applications/subl-urlhandler.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove all merged branches except "develop" branch | |
git branch -r --merged | grep -v master | grep -v '^ develop$' | sed 's/origin\///' | xargs -n 1 git push --delete origin | |
# to remove them | |
git branch -r --merged | grep -v master | grep -v '^ development$' | sed -e 's/origin\///' | xargs -n 1 git branch --delete | |
# track all remote branches locally | |
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..." | |
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n" | |
## Gnuplot settings | |
echo "set terminal jpeg | |
set output 'benchmark_${1}_${2}.jpeg' | |
set title 'Benchmark: ${1} ${2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DebugUtils | |
def self.run_in_sql_transaction | |
ActiveRecord::Base.transaction do | |
yield | |
end | |
end | |
def self.time_some_code | |
time = Benchmark.realtime do | |
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :development do | |
gem 'rspec-rails' | |
gem 'factory_girl_rails' | |
gem 'better_errors' | |
gem 'binding_of_caller' | |
gem 'pry-byebug' | |
gem 'rack-mini-profiler' | |
gem 'thin' | |
gem 'marginalia' | |
gem 'pry-rails' |
NewerOlder