Skip to content

Instantly share code, notes, and snippets.

mdkarp / passUTM.js
Created August 28, 2019 23:07 — forked from dillansimmons/passUTM.js
Pass current UTMS to in page links Javascript
// JS for grabbing utm params and parsing into url
var getRefQueryParam = function() {
var temp = {};\??(?:([^=]+)=([^&]*)&?)/g, function() {
var decode = function(s) {
return decodeURIComponent(s.split("+").join(" "));
temp[decode(arguments[1])] = decode(arguments[2]);
return temp;
mdkarp / Using Github Deploy
Created September 25, 2018 16:57 — forked from zhujunsan/Using Github Deploy
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
mdkarp / 0_reuse_code.js
Created July 27, 2016 15:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
mdkarp / .gitignore
Last active August 29, 2015 14:06 — forked from octocat/.gitignore
# Compiled source #
# Packages #
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
mdkarp / gist:4015387
Created November 5, 2012 04:46 — forked from zhendershot/gist:3607211
REST API Upload to S3 in Titanium
function upload(name, file, callback) {
Ti.include('lib/sha-aws.js'); // file comes from this URL's project:
Ti.include('lib/webtoolkit.utf8.js'); // code for this file from this URL:
Ti.include('lib/date.js'); // file comes from this URL:
var AWSAccessKeyID = appGlobal.config.s3AccessKey;
var AWSSecretAccessKey = appGlobal.config.s3SecretKey;
var AWSBucketName = appGlobal.config.s3BucketName;
var AWSHost = appGlobal.config.s3Host;