Skip to content

Instantly share code, notes, and snippets.

def syntax_checker(string)
split_arr = string.split("")
length = split_arr.size
return false if length <= 1
return false if length.odd?
mirror = []
split_arr[length/2..length-1].each do |c|
if c == "]"
mirror << "["
end
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@jimishjoban
jimishjoban / gist:fba755fe995f22340b02
Created September 24, 2015 15:03
Static IP Configuration
# The loopback interface
auto lo
iface lo inet loopback
# Configuration for eth0
# We no longer need to use aliases (eg. eth0:0 eth0:1 eth0:2)
# This line ensures that the interface will be brought up during boot
auto eth0
allow-hotplug eth0
@jimishjoban
jimishjoban / gist:ac7d003318b08d09ef25
Created September 24, 2015 06:31
/etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@jimishjoban
jimishjoban / nginx_coupons
Created April 28, 2011 14:44
Nginx coupons config
location /coupons/ {
alias /home/jjobanputra/code/coupon/upload/;
index index.php index.html index.htm;
if (-e $request_filename) {
expires 30d;
break;
}
rewrite /coupons/(.+)$ /coupons/index.php?q=$1;
}