Skip to content

Instantly share code, notes, and snippets.

@tmarshall
tmarshall / aws-sns-example.js
Last active October 30, 2022 06:12
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@nolanlawson
nolanlawson / index.html
Last active March 13, 2017 18:44
Demonstrate attachments in PouchDB
<html>
<body>
<pre id="display"></pre>
<script src="//cdn.jsdelivr.net/pouchdb/3.1/pouchdb.js"></script>
<script>
(function () {
'use strict';
var display = document.getElementById('display');
display.innerHTML = (display.innerHTML || '');
@kyle-ilantzis
kyle-ilantzis / open-w-atom.reg
Last active June 1, 2021 17:20
Adds 'Open in Atom' to context menu in Windows Explorer.
Windows Registry Editor Version 5.00
;
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer.
;
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work
; https://github.com/Zren/atom-windows-context-menu/issues/1.
;
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with
; the path to the atom executable on your machine.
@mattheyan
mattheyan / CommandPromptHere.reg
Last active December 14, 2016 20:24
Command Prompt Here Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here]
"icon"="C:\\Windows\\system32\\cmd.exe,0"
[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\Command Prompt Here]
"icon"="C:\\Windows\\system32\\cmd.exe,0"
@julianshapiro
julianshapiro / IE.js
Last active May 11, 2024 15:22
Future-Proof IE Version Detection Without User Agent Sniffing
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
@marcelosomers
marcelosomers / git-php-webhook.php
Last active May 13, 2024 12:10
A basic webhook for deploying updates to repos on Github to your local server
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed
@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
@TomByrne
TomByrne / MultiExporter.jsx
Last active May 5, 2024 21:54
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
@travismillerweb
travismillerweb / scroll-shadow.css
Created September 23, 2013 18:57
CSS - Google Scroll Shadow
/*
Gmail/Google Reader Sidebar Scroll Shadows
-------------------------------------------
Neat effect that mimics the scroll shadows that appear in the GOogle sitde bar and visually cues users to scroll up or down depending on their position.
Credit goes to Lea Verou for this awesome find.
Source:
Lea's Talk: http://www.youtube.com/watch?v=3ikye7Qc7Ak
Code Source: http://lea.verou.me/more-css-secrets/#slide9
@elboletaire
elboletaire / powershell_here.reg
Created September 7, 2013 04:04
Open powershell here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
@="Obre powershell"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -NoExit -NoLogo -Command Set-Location -LiteralPath '%L'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]