Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
$('.parentElement').on('click', '.dynamicChildElement', function() {
$.ajax('/relative_file_path.php', {
type: "POST", // Defaults to get
data: {
'key' : 'value',
'key' : 'value'
},
dataType: 'json', // If retrieving JSON
contentType: 'application/json', // If retrieving JSON
var ajaxTemplate = {
init: function() {
$('.parentElement').on( 'click', '.dynamicChildElement', this.ajaxCall )
},
ajaxCall: function() {
$.ajax('/relative_file_path.php', {
function Example(el) {
this.el = el;
function something() {
// Do code here
}
$.fn.pluginName = function(options) {
this.each(function() {
var settings = $.extend({
'key1' : 'value1',
'key2' : 'value2',
'key3' : 'value3'
}, options);
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@joshuaadrian
joshuaadrian / US States PHP Array
Created February 25, 2014 16:19
With state abbreviations for keys
$us_states = array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District Of Columbia',
$countries = array(
"Afghanistan",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica",
"Antigua and Barbuda",
$languages = array(
'Afrikanns',
'Albanian',
'Arabic',
'Armenian',
'Basque ',
'Bengali',
'Bulgarian ',
'Catalan',
'Cambodian',
@joshuaadrian
joshuaadrian / SASS Grid System
Last active August 29, 2015 14:01
Simple SASS grid system meant to be light weight and easy to use
/************************************************************************/
/* GRID VARIABLES
/************************************************************************/
$grid-gutter-width : 15px;
$grid-column-amount : 12;
$grid-large-breakpoint : 1200px;
$grid-medium-breakpoint : 992px;
$grid-small-breakpoint : 768px;
# Web server setup... SSH Keys... You can use ssh keys to log into the server without a password. I assume you have already generated your keys.
Open you public key at ~/id_rsa.pub, and copy it.
On the server, add your key to ~/.ssh/authorized_keys.
# On the web server, initialize an empty Git repository. First SSH into the server, then go to the website’s root directory, and run:
$ git init
# Suppress git receive error... Add this to the server’s .git/config file to suppress an error when it receives a push:
[receive]