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
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331' | |
version '7.3.515' | |
def features; %w(tiny small normal big huge) end | |
def interp; %w(lua mzscheme perl python python3 tcl ruby) end |
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
# Example MySQL config file for small systems. | |
# | |
# This is for a system with little memory (<= 64M) where MySQL is only used | |
# from time to time and it's important that the mysqld daemon | |
# doesn't use much resources. | |
# | |
# MySQL programs look for option files in a set of | |
# locations which depend on the deployment platform. | |
# You can copy this option file to one of those | |
# locations. For information about these locations, see: |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "nuperty-drupal" |
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
YOUR_ISP=www.google.com | |
while : | |
do | |
ping -t 2 -o -c 1 $YOUR_ISP || open alarm.wav | |
sleep 1 | |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "nuperty" |
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
Monquiro.Views ||= {} | |
class Monquiro.Views.GoogleMapView extends Backbone.View | |
# A Backbone View always holds a div element in his @el variables. | |
id: 'map' # Sets the id of the @el div | |
initialize: () -> | |
$(@el).css('width','100%') # You can access the @el div with jQuery even if it's not yet on the document. | |
$(@el).css('height','600px') | |
@map = null |
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
Backbone.js Events not firing | |
MapModalView = Backbone.View.extend({ | |
events: { | |
'click #closeMapModal': 'closeModal', | |
'click #modal_streetview': 'renderStreet' | |
}, | |
initialize: function(){ | |
this.el = $('.modal_box'); | |
this.template = _.template($('#map-modal-template').html()); | |
_.bindAll(this, 'renderMap', 'renderPin'); |
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
http://blog.desgrange.net/2012/06/05/caldav-carddav-debian-davical-ios-ical.html | |
mike@rbci:~$ psql -U postgres | |
psql (9.0.3) | |
Type "help" for help. | |
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
UPDATE 1 | |
postgres=# \c template0 | |
You are now connected to database "template0". |
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
#!/usr/local/bin/ruby -w | |
require "csv" | |
CSV_FILE_PATH = File.join(File.dirname(__FILE__), "input.csv") | |
CSV.foreach(CSV_FILE_PATH) do |row| | |
puts "ROW -- #{row}" | |
end | |
CSV_FILE_PATH_OUT = File.join(File.dirname(__FILE__), "output.csv") |
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
1.9.2p318 :001 > a= ['a','b','c','d'] | |
=> ["a", "b", "c", "d"] | |
1.9.2p318 :002 > b = [1,2,3,4] | |
=> [1, 2, 3, 4] | |
1.9.2p318 :003 > c = a.zip(b).flatten.compact | |
=> ["a", 1, "b", 2, "c", 3, "d", 4] | |
1.9.2p318 :004 > h = Hash[*c.flatten] | |
=> {"a"=>1, "b"=>2, "c"=>3, "d"=>4} |