Skip to content

Instantly share code, notes, and snippets.

View adunkman's full-sized avatar

Andrew Dunkman (he/him) adunkman

View GitHub Profile
@adunkman
adunkman / bundle.js
Created September 18, 2014 14:58
Sample of using connect-assets (mincer/sprockets-style concatenation) without globals.
//= require closure_start
//= require jQuery
//= require the_rest_of_your_dependencies
//= require_self
//= require closure_end
var something = function () {
return "this also gets included in the closure, since require_self is defined".
};

Keybase proof

I hereby claim:

  • I am adunkman on github.
  • I am adunkman (https://keybase.io/adunkman) on keybase.
  • I have a public key whose fingerprint is 6DD1 FC34 52A3 B4D7 39F6 C092 1AF3 8D02 5A7B 51A9

To claim this, I am signing this object:

@adunkman
adunkman / hacked-together.js
Created April 9, 2015 19:11
A quick program thrown together to run some stats on an export of Bugsnag errors.
var _ = require("./vendor/assets/javascripts/vendor/underscore.js");
var parts = [
require("/Users/adunkman/Downloads/arc-response-2015 Apr 9 11-21-29.json"),
require("/Users/adunkman/Downloads/arc-response-2015 Apr 9 11-23-02.json")
];
var complete = parts.reduce(function (a, b) { return a.concat(b); });
var reportBy = function (name, grouper) {
@adunkman
adunkman / README.md
Created May 5, 2015 14:56
Platform bookmarklet
@adunkman
adunkman / bookmarklet.js
Created June 19, 2015 20:21
Hacking the Harvest Platform
(function () {
var github = function () {
var parts;
if (parts = window.location.pathname.match(/^\/([^\/]+\/[^\/]+)\/(?:issues|pull)\/(\d+)/)) {
var repo = parts[1];
var issue = parts[2];
var url = window.location.href;
var name = document.querySelector(".js-issue-title").innerText;
window.open([
@adunkman
adunkman / index.js
Last active August 29, 2015 14:27
Simple proof-of-concept for Content-Security-Policy in report-only mode.
var app = require("express")();
// JSON parse the body of requests with `application/csp-report` content type.
app.use(require("body-parser").json({
type: "application/csp-report"
}));
// Page with CSP header (in report-only mode).
app.get("/", function (req, res) {
res.setHeader("Content-Security-Policy-Report-Only", [
@adunkman
adunkman / sheets-poc.html
Created September 8, 2015 22:38
A quick proof-of-concept to use Google Sheets as a backend.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script>
(function () {
var key = "1HwGVE-MqVmeLwcfljmBmuTD55arVxsElG3C2urJadAw";
var url = "https://spreadsheets.google.com/feeds/list/" + key + "/od6/public/values?alt=json";
@adunkman
adunkman / lessjs.rb
Created April 14, 2011 21:53 — forked from andyfowler/lessjs.rb
Jekyll plugin to render LESS (lesscss.org) files during generation.
module Jekyll
class LessCssFile < StaticFile
def write(dest)
# do nothing
end
end
class LessJsGenerator < Generator
safe true
@adunkman
adunkman / index.html
Created January 14, 2012 15:33
Relay messages from RabbitMQ to a browser using Socket.io - client
<!DOCTYPE html>
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script>
(function () {
var onMessage = function (data) {
// Do something with the message data
};
@adunkman
adunkman / gist:2580972
Created May 2, 2012 22:19 — forked from hellosmithy/transparency.styl
Cross-browser alpha transparent background CSS (rgba) Stylus mixin
// background transparency
background-transparency(color, alpha = 1)
ms-color = argb(color, alpha)
background rgb(color)
background rgba(color, alpha)
.lt-ie8 &
zoom 1
.lt-ie9 &
background transparent
filter s('progid:DXImageTransform.Microsoft.gradient(startColorstr=%s,endColorstr=%s)', ms-color, ms-color)