Skip to content

Instantly share code, notes, and snippets.

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

Peter deHaan pdehaan

🏠
Working from home
View GitHub Profile
@pdehaan
pdehaan / bootstrap_labels.html
Created September 26, 2011 00:13
Twitter Bootstrap "label" example.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Twitter Bootstrap "label" example</title>
<link href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css" rel="stylesheet" />
<style type="text/css">
body {
padding: 40px;
}
@pdehaan
pdehaan / scrollTo.html
Created August 31, 2012 22:50
DataView scroll to top #senchatouch
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title></title>
<link href="http://cdn.sencha.io/try/touch/2.0.1/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
<script src="http://cdn.sencha.io/try/touch/2.0.1/sencha-touch-all-debug.js"></script>
<script>
Ext.application({
launch: function () {
@pdehaan
pdehaan / examples.rss
Created September 29, 2012 20:56
ExamplesRSS
<?xml version="1.0" standalone="yes" ?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<title>Just a bunch of mediocre Peter Example sites</title>
@pdehaan
pdehaan / Gruntfile.js
Created November 6, 2013 20:44
Quickly check for the existence of a specific copyright header in a project using a custom Grunt task.
module.exports = function (grunt) {
grunt.initConfig({
copyright: {
files: [
"**/*.js",
"!**/node_modules/**"
],
options: {
pattern: "This Source Code Form is subject to the terms of the Mozilla Public"
}
@pdehaan
pdehaan / Gruntfile.js
Created November 7, 2013 00:31
Start a server on port 8000 using Grunt.
module.exports = function (grunt) {
grunt.initConfig({
connect: {
server: {
options: {
keepalive: true,
port: 8000,
base: "."
}
}
@pdehaan
pdehaan / index.js
Created April 11, 2014 02:35
Scan your Firefox bookmarks exported JSON for HTTPS bookmarks succeptable to heartbleed exploit
var fs = require("fs");
var url = require("url");
var heartbleed = require("heartbleed");
var jsonselect = require("jsonselect");
var Promise = require("promise");
var readFile = Promise.denodeify(fs.readFile);
readFile("bookmarks.json", "utf8").then(JSON.parse).then(function (data) {
function loadPage(address, route, lang){
page.customHeaders = {'accept-language': lang};
var address = url + route;
var docLocator;
var fxaHeader;
if (page === 'signup'){
docLocator = 'sign-up';
fxaHeader = "fxa-signup-header";
}else if(page === 'signin'){
@pdehaan
pdehaan / index.js
Created February 13, 2015 02:04
Grab public user Gists using JavaScript
'use strict';
var GitHubApi = require('github');
var github = new GitHubApi({
version: "3.0.0"
});
github.gists.getFromUser({
user: 'pdehaan',
{
"name": "Push Testing",
"strategies": [
{
"name": "Single Serverz",
"description": "Single PushGo server, 2 sets of testers for peak of 200k connections.",
"container_sets": [
{
"name": "Test Cluster",
"instance_count": 1,
@pdehaan
pdehaan / gist_create.js
Created March 10, 2015 17:13
Creates an anonymous, secret Gist.
'use strict';
var fs = require('fs');
var github = require('octonode');
var client = github.client();
var gist = client.gist();
gist.create({
description: 'gist description',
files: {