Skip to content

Instantly share code, notes, and snippets.

@pixelprogrammer
pixelprogrammer / .env
Last active July 20, 2018 22:28
Gulp Project Setup
# SERVER_TYPE:
# options are static or server (default is static)
SERVER_TYPE=static
# SERVER_HOST:
# only used if SERVER_TYPE is server
# this will be your url to your website example: mywebsite.local
SERVER_HOST=localhost
# SERVER_LAUNCH:
@pixelprogrammer
pixelprogrammer / post-merge
Last active January 23, 2018 17:51
Keep file permissions and ownerships consistent after a git pull
#!/bin/sh
previous_version=$(git rev-parse HEAD@{1})
git submodule init
git submodule update
git whatchanged --no-commit-id --name-only -r $previous_version.. | sort | uniq | xargs -n1 chown yoursite:psacln
git whatchanged --no-commit-id --name-only -r $previous_version.. | sort | uniq | xargs chmod g+rw
find ./* -type d -exec chown yoursite:psacln {} \;
@pixelprogrammer
pixelprogrammer / wp
Created December 27, 2014 19:23
A simple wordpress install script
#!/bin/bash -e
# Wordpress shell script
case $1 in
install)
url="http://wordpress.org/"
version="latest"
if [$2];
@pixelprogrammer
pixelprogrammer / .global-gitignore
Last active August 29, 2015 14:05
This is the global gitignore file for my projects
# Ignore Sublime specific files
*.sublime-*
# Mac Specific files
.DS_Store
# Node Modules should be ignored
node_modules/
# Ignore all SFTP config files

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@pixelprogrammer
pixelprogrammer / iedetect..js
Created September 27, 2012 21:46 — forked from padolsey/gist:527683
Javascript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}