Skip to content

Instantly share code, notes, and snippets.

View hyeomans's full-sized avatar
🏠
Working from home

Hector Yeomans hyeomans

🏠
Working from home
View GitHub Profile
@hyeomans
hyeomans / vagrant_install.md
Last active December 17, 2015 02:19
Deploying Rails app to Vagrant on Ubuntu 12.04

Warming up

gem install vagrant

vagrant box add precise64 http://dl.dropbox.com/u/1537815/precise64.box
vagrant up && vagrant ssh

sudo apt-get -y update && sudo apt-get -y install curl git-core python-software-properties

Custom Apt-Get repo

# simple ruby code example for running python script
path_to_script = File.dirname(__FILE__)
puts "It's a ruby script"
puts "Run python script with backticks"
puts "Result is available in caller.ru"
puts `python #{path_to_script}/processing.py UserName 37`
@hyeomans
hyeomans / python_regex.rb
Created May 10, 2013 17:08
Using the block I can filter which operation I want to return with a simple string, otherwise it will return the 3 operations in an array.
require 'open3'
class PythonRegex
extend Open3
def self.calculate_intersection(first_regex, second_regex)
popen3('python', 'lib/services/greenery/main.py', first_regex, second_regex) do |stdin, stdout, stderr|
if block_given?
stdout.read.split("\n").select { |line| line.start_with? yield }
else
stdout.read.split("\n").each { |line| p line }
end
@hyeomans
hyeomans / .gitconfig
Created May 10, 2013 17:48
Dot files
[color]
diff = auto
status = auto
branch = auto
[color "status"]
changed = yellow
added = green
untracked = red
@hyeomans
hyeomans / table.haml
Last active December 17, 2015 23:19
Tabla en Haml
%table#id_tabla
%thead
%th Columna 1
%th Columna 2
%tbody
%tr
%td
%label Hola
%td
%label World
Option Infer On
Option Compare Text
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
@hyeomans
hyeomans / my_profile.ps1
Created September 12, 2013 14:48
My PS profile
# Executables
function subl { &"${Env:ProgramFiles}\Sublime Text 2\sublime_text.exe" $args }
function visual { &"${Env:ProgramFiles}\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" $args }
#Directories
function open-table { Set-Location 'C:\Users\Hector\Documents\Visual Studio 2012\Projects\OpenTable' }
#Files
function hosts { subl C:\Windows\System32\drivers\etc\hosts }
@hyeomans
hyeomans / gist:7328640
Created November 6, 2013 00:09
Removing obj and bin folders
function remove_bin_obj_force {
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
}
@hyeomans
hyeomans / profile.ps1
Last active December 27, 2015 12:49
My powershell profile.
# Executables
function subl { &"C:\Program Files\Sublime Text 2\sublime_text.exe" $args }
function visual { &"${Env:ProgramFiles}\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" $args }
#Directories
function development {
Set-Location 'C:\development'
}
#Files
@hyeomans
hyeomans / gist:7995798
Created December 16, 2013 22:42
Installing erlang
sudo apt-get install yaws
erlang-dev and erlang-parsetools.