This file contains hidden or 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
| # List what ports are in use on OS X | |
| sudo lsof -iTCP -sTCP:LISTEN -P |
This file contains hidden or 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
| #!/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: |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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/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. |
This file contains hidden or 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
| user@homebox ~ $ ssh-keygen -t rsa | |
| user@homebox ~ $ scp ~/.ssh/id_rsa.pub user@'servername':.ssh/authorized_keys |
This file contains hidden or 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
| #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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| function usp_ExternalSPROC(){ | |
| try { | |
| var AConnection, Tbl, Field_NameR; | |
| // Create a new Connection object | |
| AConnection = ADO.CreateConnection(); |
This file contains hidden or 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
| find . -type f -exec grep -nH -e SearchStr {} /dev/null \; |
This file contains hidden or 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
| <?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? |