Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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/
# 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 / 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
@zealinux
zealinux / 1-server.md
Created April 13, 2017 14:01 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@zealinux
zealinux / times.js
Created April 24, 2017 09:11 — forked from FGRibreau/times.js
Ruby .times & .upto & .downto methods in JavaScript
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
@zealinux
zealinux / .gitignore
Created April 30, 2017 02:18 — forked from smebberson/.gitignore
Nodejs static web server boilerplate
.DS_Store
node_modules/