Skip to content

Instantly share code, notes, and snippets.

View williamli's full-sized avatar

Willi#m ⬣ williamli

View GitHub Profile
@chrillo
chrillo / mobilehtaccess
Created November 29, 2011 08:11
htaccess redirect all mobile traffic to specific landing page
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/landingpage/.$
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|
@williamli
williamli / store.create.json
Created October 22, 2012 09:26
/api/store
{
"store_id": null,
"storetype": {
"id": null,
"storetype_value" : {
"id" : null, "content_value" :
[
{
"lang" : "en",
"value" : "Food"
@purwandi
purwandi / deploy.rb
Created November 19, 2012 13:09
Laravel Capistrano Receipes
set :application, "App Name" # Your app name
set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository
set :document_root, "/home/user/www/awesome_app"
set :deploy_via, :remote_cache
# SSH Settings
set :user, "user_ssh"
set :password, "password_ssh"
set :use_sudo, false
@williamli
williamli / sublime.desktop
Created July 28, 2013 02:09
Ubuntu application icon for Sublime Text 2
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
Comment=The best IDE in the world
GenericName=Text Editor
Keywords=IDE;Editor;TextEditor;Development
Exec=/usr/bin/Sublime\ Text\ 2/sublime_text %U
Terminal=false
Type=Application
Icon=/usr/bin/Sublime Text 2/Icon/256x256/sublime_text.png
<script>
window.intercomSettings = {
app_id: "kzlr5f7u",
anonymous: true
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/kzlr5f7u';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
@clubdeuce
clubdeuce / gist:5811516
Created June 19, 2013 03:35
Codeship configuration for WP unit testing
curl http://cs.sensiolabs.org/get/php-cs-fixer.phar -o php-cs-fixer.phar
curl -s http://getcomposer.org/installer | php
php composer.phar install --dev --no-interaction --prefer-source
mkdir -p build/logs
mkdir -p build/cov
#phpUnit setup
export WP_VERSION=3.5.1
export WP_MULTISITE=0
mkdir -p /tmp/wordpress
export WP_CORE_DIR=/tmp/wordpress/
@chipotle
chipotle / deploy.rb
Last active February 8, 2018 18:54
Capistrano deployment script for Laravel 4
# Capistrano Laravel 4 Deployment Tasks
# Watts Martin (layotl at gmail com)
# https://gist.github.com/chipotle/5506641
# updated 14-Aug-2013
# Assumptions:
#
# - You are using a .gitignore similar to Laravel's default, so your
# vendor directory and composer(.phar) are *not* under version control
# - Composer is installed as an executable at /usr/local/bin/composer
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@jeremyepling
jeremyepling / actions-gcloud-cicd.yaml
Created August 21, 2019 21:02
Build and deploy to gcloud
name: Build and deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
container: google/cloud-sdk:latest
@williamli
williamli / export_github_issues.py
Created July 3, 2012 17:21 — forked from jj0hns0n/export_github_issues.py
Export GitHub issues to a csv file
import csv
from github2.client import Github
# api settings for github
git_username = ''
git_api_token = ''
git_repo = ''
# csv name
csv_name = "git_hub_issues.csv"