Skip to content

Instantly share code, notes, and snippets.

@zlu
zlu / connfu_sipmethod.log
Created August 3, 2011 20:07
dialing multiple endpoints with join
Use case:
incoming offer to usera@127.0.0.1 (prism server) with tropo2 build 323.
i issue two dials nested with join to zlu@iptel.org and openvoice@iptel.org
neither endpoint rings and an error presence is returned.
=========== START OF CONNFU LOG
D, [2011-08-03T13:07:17.815233 #31271] DEBUG -- : Established @connection to Connfu Server with JID: jid://usera:1@127.0.0.1
D, [2011-08-03T13:07:17.834454 #31271] DEBUG -- : Queue implementation: #<Connfu::Queue::InProcess:0x00000100bfbc50 @queues={}>
D, [2011-08-03T13:07:24.605770 #31271] DEBUG -- : Receiving presence from server
@zlu
zlu / gist:6716050
Created September 26, 2013 15:45
Incompatible jquery-rails versions
zlu@zlu-mba:~/projects/zeeweibo (master *)$ bundle install
Fetching https://github.com/browsermedia/browsercms.git
remote: Counting objects: 40005, done.
remote: Compressing objects: 100% (13669/13669), done.
remote: Total 40005 (delta 25567), reused 38711 (delta 24438)
Receiving objects: 100% (40005/40005), 12.02 MiB | 260.00 KiB/s, done.
Resolving deltas: 100% (25567/25567), done.
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
@zlu
zlu / gist:6064975
Created July 23, 2013 18:39
ruby next
for i in 0..5 do; if i < 4; next; else; p 'hi'; end; end
=> 'hi'
'hi'
1.next
=> 2
next can't be used as a variable name but can be used as a method name.
@zlu
zlu / it_books.md
Last active November 19, 2015 02:31
IT Books

##Physical Books ###Novels

  • Angels & Demon (d. brown)
  • The old man and the sea (e. hemingway)
  • A tale of two cities (c. dickens)
  • Light in August (William Faulkner)

###Tech

  • How to build microservices (Nginx)
(defvar zlu-map (make-keymap) "My personal mode map")
(define-key global-map "\C-c" zlu-map)
(define-key zlu-map "g" 'goto-line)
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 120))
(add-to-list 'default-frame-alist (cons 'width 80)))
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 120))
(add-to-list 'default-frame-alist (cons 'width 80)))
@zlu
zlu / gist:1865217
Created February 19, 2012 19:05
error running julia
zlu@zlu-mba:/usr/local/src/julia (master)$ ./julia
dlopen(libarpack, 2): image not found
error during init:
could not load module libarpack
in dlopen, /Users/viral/julia/j/base.j:99 sys.ji:17
# Emacs backup and recover #
############################
*~
\#*
# IntelliJ and RubyMine #
#########################
.idea
# Database #