Skip to content

Instantly share code, notes, and snippets.

@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)
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@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.
(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 #