Skip to content

Instantly share code, notes, and snippets.

View jpablobr's full-sized avatar

Pablo Barrantes jpablobr

View GitHub Profile
@jpablobr
jpablobr / ports.sh
Created April 22, 2010 19:55 — forked from defunkt/ports.sh
# List what ports are in use on OS X
sudo lsof -iTCP -sTCP:LISTEN -P
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 30th March 2010:
# MAKE SURE YOU HAVE VIRTUAL BOX INSTALLED http://www.virtualbox.org/wiki/Downloads
#
# Copy paste this file in your terminal
# The following will create a dir which contains the rails repo.
# You can start edit this later on. It will also create a Gemfile and a Vagrantfile.
# It will run bundle and it will # download and activate the virtualbox that contains
# everything you need to start # testing.
mkdir rails_test_box
cd rails_test_box
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
user@homebox ~ $ ssh-keygen -t rsa
user@homebox ~ $ scp ~/.ssh/id_rsa.pub user@'servername':.ssh/authorized_keys
#http://snippets.dzone.com/posts/show/5449
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
end
require 'fastercsv'
FasterCSV.foreach('db/data/file.csv') do |row|
Model.create(:name=>row[0], :phone_number=>row[1], :fax_number=>row[2], :email=>row[3]) #etc...
end
# $ rake db:load_from_csv
function usp_ExternalSPROC(){
try {
var AConnection, Tbl, Field_NameR;
// Create a new Connection object
AConnection = ADO.CreateConnection();
find . -type f -exec grep -nH -e SearchStr {} /dev/null \;
<?php
// PHP Proxy
// Responds to both HTTP GET and POST requests
//
// Author: Abdul Qabiz
// March 31st, 2006
//
// Get the url of to be proxied
// Is it a POST or a GET?