Skip to content

Instantly share code, notes, and snippets.

View ntwb's full-sized avatar
🏠
Working from home

Stephen Edgar ntwb

🏠
Working from home
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
server_name example.com;
root /var/www;
@vertiginous
vertiginous / gist:772895
Created January 10, 2011 15:27
Installing oniguruma on windows with devkit.

NOTE: If you use ansicon make sure it is not loaded

Download the Oniguruma library.

I have had good luck with 5.9.1 and 5.9.2.

Extract it to a temporary folder.

I used C:\Users\gthiesfeld\Work\repo\onig-5.9.2.

@ssbarnea
ssbarnea / mysql-convert-utf8.py
Created July 6, 2011 18:48
Script to convert a a database to use utf8 encoding
#! /usr/bin/env python
import MySQLdb
host = "localhost"
passwd = ""
user = "root"
dbname = "mydbname"
db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname)
cursor = db.cursor()
@jpmckinney
jpmckinney / twitter-bootstrap-ie6.scss
Created November 14, 2011 23:31
SCSS additions to make Twitter Bootstrap work in IE6
// Assumes you are using <html> conditional classes as described here:
// http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
.lt-ie7 {
// blockquote small:before{content:'\2014 \00A0';}
blockquote small:before{content:"";}
// [class*="span"]{display:inline;float:left;margin-left:20px;}
.span1{display:inline;float:left;margin-left:20px;}
.span2{display:inline;float:left;margin-left:20px;}
.span3{display:inline;float:left;margin-left:20px;}
.span4{display:inline;float:left;margin-left:20px;}
@anointed
anointed / functions.php
Created November 22, 2011 05:19 — forked from kunalb/functions.php
Overriding the default bbpress theme
/**
* Set the theme compat theme properties
*
* @since bbPress (r3311)
*
* @global bbPress $bbp
* @param BBP_Theme_Compat $theme
* @uses current_theme_supports()
*/
function bbp_setup_new_theme_compat() {
@jeffsebring
jeffsebring / gisted.php
Created April 1, 2012 08:41
Gisted Shortcode WordPress Plugin Class
<?php
/*
Plugin Name: Gisted
Plugin URI: http://jeffsebring.com/wordpress/plugins/gisted
Description: Print your Github Gists as HTML on your WordPress blog
Author: Jeff Sebring
Version: 0.1.2
Author URI: http://jeffsebring.com/
Copyright 2012 Jeff Sebring
@jeremyclark13
jeremyclark13 / simple_forum_2_bbpress.php
Created April 5, 2012 12:50
Simple:Press forum to bbPress forum convertor
<?php
/*
Plugin Name: Simple Press to bbPress
Plugin URI: http://www.4-14.org.uk/
Description: Import Simple Press forums to bbPress
Author: Mark Barnes
Version: 0.1
Author URI: http://www.4-14.org.uk/
*/
@nacin
nacin / gist:2323060
Created April 6, 2012 21:23
Nacin's SVN override
# SVN override to prevent commits that try to implicitly commit more than one file.
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci,
# which usually results in me writing longer and more helpful commit messages.
# Also, it prevents me from committing unrelated code, so there's that.
#
# Also checks for error_log, var_dump, and console.log, and rejects these commits.
function svn() {
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then
svn stat --ignore-externals | grep '^[^?X]'
@markjaquith
markjaquith / gist:2628225
Last active March 29, 2023 23:30
Script to sync WordPress SVN to GitHub
#!/bin/bash
# cd into the directory
cd ~/gitsync/github-wordpress-sync/;
# Make sure we are not already running
if [ -f .sync-running ];then
if test ! `find ".sync-running" -mmin +10`;then
# Currently running, but not stuck
exit 1;
fi
fi;