Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
server { | |
# Redirect yoursite.com to www.yoursite.com | |
server_name yoursite.com; | |
rewrite ^(.*) http://www.yoursite.com$1 permanent; | |
} | |
server { | |
# Tell nginx to handle requests for the www.yoursite.com domain | |
server_name www.yoursite.com; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#!/usr/local/bin/gosh | |
(use srfi-1) | |
(use text.csv) | |
(use file.util) | |
(use util.list) | |
(use gauche.parseopt) | |
(define (usage) | |
(print "Usage: csv2sql [options ...] <csv-file>") |
#! /bin/bash | |
#guarantee you are in the directory you are in (src: http://stackoverflow.com/a/246128) | |
cd -P "$(dirname "$0")" | |
# basically traverse down all directories until you run across a | |
# .git/.svn/.hg/.fslckout/CVS directory/file, then update/pull the directory (stop traversing) | |
#updaterepo <folder type found> <path name to display> |
# function for .bash-profile or .bashrc | |
# od <file> [<file2>] | |
# diff's the given file using opendiff based on the file's vcs | |
# supports svn, git, mercurial, fossil, & CVS | |
# can specify any path, checks are done where the file is | |
# when file2 is specified, fall back to default opendiff behavior | |
od() | |
{ |
#include "mysql_connection.h" | |
#include <cppconn/driver.h> | |
#include <cppconn/exception.h> | |
#include <cppconn/resultset.h> | |
#include <cppconn/statement.h> | |
#include <cppconn/prepared_statement.h> | |
#include <memory> | |
#include <fstream> | |
#include <vector> | |
#include <cstring> |
#!/bin/bash +xv | |
declare WGET=/usr/bin/wget | |
declare SED=/bin/sed | |
declare INVOKE=/usr/sbin/invoke-rc.d | |
#declare TORIFY=/usr/bin/torify | |
#declare TORRESOLVE=/usr/bin/tor-resolve | |
declare -i EXIT_VALUE=0 |
#!/bin/bash | |
USERNAME=<username> | |
PASSWORD=<password> | |
INSTANCE="<company>.atlassian.net" | |
LOCATION="./Backups/" | |
mkdir "Backups" | |
# Grabs cookies and generates the backup on the UI. |
''' | |
Easy Mac | |
Copyright (2015) Sean Beck | |
Licensed under Creative Commons Attribution-ShareAlike 4.0 International | |
See: https://creativecommons.org/licenses/by-sa/4.0/ | |
Easily change your MAC address on Linux using `ifconfig` | |
''' | |
#!/usr/bin/python2.7 |