Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'ostruct'
class LineStatus
def initialize
@jph
jph / .zshrc
Created January 31, 2012 22:48
zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="fishy"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export PATH=usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
@jph
jph / gist:4114963
Created November 19, 2012 23:49
serial interface
require 'rubygems'
require 'serialport'
sp = SerialPort.new "/dev/my-modem", 9600 # baud rate
do
puts sp.read
while !sp.eof?
@jph
jph / gist:4489811
Created January 9, 2013 01:31
howdoi build errors
$ sudo python setup.py install
Password:
running install
running bdist_egg
running egg_info
creating howdoi.egg-info
writing requirements to howdoi.egg-info/requires.txt
writing howdoi.egg-info/PKG-INFO
writing top-level names to howdoi.egg-info/top_level.txt
writing dependency_links to howdoi.egg-info/dependency_links.txt
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
require 'csv'
csv = CSV.read "ips.csv"
config = []
csv.each_with_index do |row,index|
config << "Dest#{index}=#{row[0].gsub(/ /,'')}-#{row[3].gsub(/ /,'')}-#{row[2]}"
end
puts config.join "\r\n"
module Billable
extend ActiveSupport::Concern
included do
attr_accessible :line_item, :line_item_id, :custom_pricing
belongs_to :line_item
end
end
~$ brew update
Error: /usr/local/Library/Homebrew/tap_migrations.rb:8: syntax error, unexpected '>'
'libgtextutils' -> 'homebrew/science',
^
/usr/local/Library/Homebrew/tap_migrations.rb:8: syntax error, unexpected ',', expecting $end
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/cmd/update.rb:3:in `require'
/usr/local/Library/Homebrew/cmd/update.rb:3
/usr/local/Library/brew.rb:51:in `require'
[
{ "keys": ["home"], "command": "move_to", "args": { "to": "bol" } },
{ "keys": ["end"], "command": "move_to", "args": { "to": "eol" } },
{ "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } },
{ "keys": ["shift+home"],"command": "move_to", "args": { "to": "bol", "extend": true } },
]
@jph
jph / extensions.lua
Last active August 29, 2015 14:07 — forked from igmar/extensions.lua
require("lsqlite3")
-- Igmar: Wanneer closen we dat DB object eigenlijk ?
db = sqlite3.open('/etc/asterisk/users.sqlite')
--CONSOLE = "Console/dsp" -- Console interface for demo
--CONSOLE = "DAHDI/1"
--CONSOLE = "Phone/phone0"
TRUNK = "DAHDI/G1"