Skip to content

Instantly share code, notes, and snippets.

@zealinux
zealinux / rails http status codes
Created April 13, 2017 06:47 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
@zealinux
zealinux / cmd.sh
Created January 22, 2017 07:53 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@zealinux
zealinux / shebang.zsh
Created January 16, 2017 13:53 — forked from gwerbin/shebang.zsh
"Shebang" function for Zsh
# shebang [-iv] [-t interpreter] [-I extension] [-J [extension]] [filename]
#
# If no filename is given, print a shebang. If a filename is given, append a shebang to the file and print its contents. If a filename is given and the -I or -J options are specified, append a shebang to the file in place.
#
# OPTIONS
# -i
# Interactive mode; ask for confirmation first.
# -I
# Modify "filename" in place (as in `sed -i`) using specified extension. Extension is mandatory.
# -J
@zealinux
zealinux / Dockerfile
Created December 6, 2016 09:11 — forked from renatosousafilho/Dockerfile
Deploy com Mina, Docker e Docker Compose
FROM rails:4.2.3
MAINTAINER Renato Filho <[email protected]>
ENV HOME /home/app
ENV RAILS_ENV development
RUN useradd -m -s /bin/bash app
RUN gem install -N bundler
@zealinux
zealinux / gist:db7d9962bebd23b733f27a014cdeded7
Created December 3, 2016 13:14 — forked from hzlzh/gist:eb87294712e78d4a96c4
Proxifier 走代理程序请求规则
"Alfred 2"; idea;Thunder*; iTerm; Terminal;php; Dropbox; Sparrow; "Sequel Pro"; python; ruby; wget; curl; GitHub; git-remote-https; npm; node; perl;prl*;itunes; sftp; whois;traceroute;stroke;ssh;ALiWangwang;MacUpdate*;git*;Git;fzs*;mail;flickr*;xulr*;imess*;com.apple.im*;Airmail;Adium;Prot*;Tokens;Ali*;Lite*;file*;ssh;ftp;Adobe*;PDApp*;Creative*;Vbox*;xulrunner;Virtual*;PDApp;Bit*;Domainers;fire*;plugin*;Atom*;Tokens;.com.realmacsoftware*;Xcode;java;httpd;
@zealinux
zealinux / org-structure-as-dirs-and-files.el
Created November 20, 2016 15:29 — forked from marcowahl/org-structure-as-dirs-and-files.el
org-save-org-structure-as-dir-file-skeleton to save the org structure as dirs and files (marked with tag :file:)
(defun org-interpret-org-as-dir-file-skeleton ()
"Return the outline paths as lists.
Separated in those headlines not tagged 'file' and those tagged with 'file'."
(let (output-files output-dirs)
(org-map-entries
(lambda ()
(let* ((headline (car (cddddr (org-heading-components))))
(headline-path
(reverse
(cons

前端工程师-开放性笔试

1. HTML / CSS

以下三个效果图中任选一个,尽可能还原。(不限框架,工具,预编译语言)

点击查看大图

兼容性要求:Chrome / Firefox / IE 11 / Edge

其他:部署至jsfiddle / jsbin / github page或同类网站

@zealinux
zealinux / make-flashlight-work-on.yosemite.md
Created February 15, 2016 06:38 — forked from selaromi/make-flashlight-work-on.yosemite.md
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
@zealinux
zealinux / install_ruby_2_0_0_p247_on_osx.md
Created November 30, 2015 06:11 — forked from runlevel5/install_ruby_2_0_0_p247_on_osx.md
Installing Ruby 2.0.0-p247 on OSX 10.7+

How to install Ruby 2.0.0-p247 on Mac OSX 10.7+

RVM:

rvm get stable && rvm reload

Firstly, the OpenSSL comes with your OSX 10.7+ is outdated, you need to get latest version