Skip to content

Instantly share code, notes, and snippets.

@dillansimmons
dillansimmons / passUTM.js
Last active January 11, 2024 18:00
Pass current UTMS to in page links Javascript
// JS for grabbing utm params and parsing into url
var getRefQueryParam = function() {
var temp = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() {
var decode = function(s) {
return decodeURIComponent(s.split("+").join(" "));
};
temp[decode(arguments[1])] = decode(arguments[2]);
});
return temp;
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active May 6, 2024 04:53
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 in replace of username/password, 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
with table_stats as (
select psut.relname,
psut.n_live_tup,
1.0 * psut.idx_scan / greatest(1, psut.seq_scan + psut.idx_scan) as index_use_ratio
from pg_stat_user_tables psut
order by psut.n_live_tup desc
),
table_io as (
select psiut.relname,
sum(psiut.heap_blks_read) as table_page_read,
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active April 8, 2024 20:45
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@rutvij-pandya
rutvij-pandya / echo_sign_api
Created January 30, 2014 07:40
EchoSign API implementation in Ruby on Rails
### Core library for EchoSign APIs
### Use a wrapper file for validations & response handling
### Get a Developer Edition account & replace "YOUR_ACCOUNT_API_KEY" with API key of your account.
### With Rails, use Savon gem for SOAP based requests.
module EchoSignApi
API_URI = 'https://secure.echosign.com/services/EchoSignDocumentService15?wsdl'
API_KEY = YOUR_ACCOUNT_API_KEY
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@cmchap
cmchap / Raspberry_Pi_Water_Sensor
Last active January 13, 2024 11:24
Raspberry Pi Water Sensor - Incredibly vague schematic here: http://fritzing.org/projects/raspberry-pi-water-sensor/
#!/usr/bin/python
#########
# About #
#########
# This script uses a Raspberry Pi to sense for the presense or absense of water.
# If there is water, an email is sent and a buzzer goes off.
# When it's dry again, another email is sent, and the buzzer turns off.
@aaronksaunders
aaronksaunders / tiparse.js
Last active November 14, 2018 18:00
Tested w/ latest version of parse "parse-1.2.7.js"
var TiParse = function(options) {
// need to convert this to requires
Ti.include("parse-1.2.7.js");
Parse.localStorage = {
getItem : function(_key) {
return Ti.App.Properties.getObject(_key);
},
setItem : function(_key, _value) {
@markpundsack
markpundsack / heroku-CVE-2013-0156.rb
Last active November 27, 2023 15:44 — forked from elliottkember/heroku-CVE-2013-0156.rb
Forked from https://gist.github.com/4489689 by elliottkember. CVE-2013-0156 is a nasty vulnerability in many versions of Rails. This script checks all your Heroku apps for this vulnerability in one quick (slow) move. More info: https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
## 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] == "==="