Skip to content

Instantly share code, notes, and snippets.

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

Colin McGraw clnmcgrw

🏠
Working from home
View GitHub Profile
@jdennes
jdennes / LICENSE
Last active March 7, 2024 04:40
Subscribing to a Campaign Monitor list using AJAX
The MIT License (MIT)
Copyright (c) James Dennes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 10, 2024 09:39 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@billerickson
billerickson / gist:3698476
Last active February 23, 2024 16:49 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@clnmcgrw
clnmcgrw / gist:9086505
Last active November 25, 2021 11:16
Google Maps API Geocode Example - PHP/JSON
<?php
// address to map
$map_address = "";
$url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($map_address);
$lat_long = get_object_vars(json_decode(file_get_contents($url)));
// pick out what we need (lat,lng)
$lat_long = $lat_long['results'][0]->geometry->location->lat . "," . $lat_long['results'][0]->geometry->location->lng;
@JacobLett
JacobLett / gist:644d0f9f232fbd2c87b8
Last active June 21, 2023 19:06
Bigcommerce theme development Grunt - requires local transmit webdav Mount
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
//src: ['template/js/libs/*.js', 'template/js/libs/cloudzoom/*.js', 'template/js/crafted.js'], //input
@clnmcgrw
clnmcgrw / gist:83fd9c95c45506874c14
Last active February 4, 2016 22:59
Mailchimp AJAX Submit w/ JSONP
$('#form-selector').submit( function(event) {
event.preventDefault();
//copy the mailchimp formm action URL, and change "post" parameter to "post-json"
var submitUrl = $(this).data('submit-url');
$.getJSON( submitUrl+"&c=?", $(this).serialize(), function(data) {
});
});
@chranderson
chranderson / nvmCommands.js
Last active July 26, 2024 20:22
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@clnmcgrw
clnmcgrw / migrate.js
Last active April 26, 2019 17:54
Data Migration Technique
// prop - destination key
// value - source key
const entityProps = {
name: 'title',
body: 'description',
day: 'date',
room: 'location',
};
// transform a destination value