Skip to content

Instantly share code, notes, and snippets.

@jebaird
jebaird / gist:3c260d08d57539a1f15a924f44321f88
Last active May 5, 2016 15:48
Parse window.location.search values to input values
(function(){
var regex = /[?&]([^=#]+)=([^&#]*)/g,
input,
match;
while( match = regex.exec( window.location.search ) ) {
input = document.querySelector('[name="'+ match[1] +'"' );
@jebaird
jebaird / test
Last active April 1, 2016 14:58
test
@jebaird
jebaird / ONTRApages - only show AU states in the state field
Last active December 6, 2016 15:42
Hides all but the Australian states in the state field for ONTRApages. Only works for chrome and firefox, ie doesn't support hiding options via css. Just drop this gist into the custom header code textarea in the settings tab
<style>
/* hide all options in the state field */
select[name="state"] option {
display: none;
}
/* target the states we want to show via the value attribute */
select[name="state"] option[value="ACT"],
select[name="state"] option[value="NSW"],
@jebaird
jebaird / README.md
Last active December 8, 2015 15:41 — forked from dharFr/README.md
Web is more beautiful in Full Screen : A simple bookmarklet to toogle fullScreenMode in modern browsers.

Web is more beautiful in Full Screen

Toogle Fullscreen Bookmarklet

A simple bookmarklet to enable fullScreenMode in modern browsers.

Usage

  • Copy loader.js code into a bookmark's location field.
@jebaird
jebaird / drupal-php-to-jekyll-exporter.php
Last active June 27, 2016 12:33
migrate a drupal site to jekyll using php
<?php
/**
* php drupal to jekyll exporter
* Jesse Baird <jebaird.com>
*
* http://jebaird.com/2013/05/17/durpal-export-to-jekyll-via-php.html
*
* This script exports blog and page types with the tags attached. It also sets the right url alias redirects
* blog types are saved in _post/
* page pages aee saved in pages/
@jebaird
jebaird / hosts to ip host
Last active November 3, 2022 23:32
generate ip host config list form the host file at http://someonewhocares.org/hosts/ . Useful for blocking adds, spyware and shocks sites for whole networks
<?php
/*
* Hosts to ip host
*
* @author Jesse Baird <jebaird@gmail.com>
* @date 12/21/2012
*
* Licensed under The MIT License
* http://opensource.org/licenses/MIT
*
@jebaird
jebaird / gist:2210552
Created March 26, 2012 23:19
cisco 851w with wireless and port forwarding
!
version 12.3
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname yourname
!
@jebaird
jebaird / jebaird.canvas-image-randomizer.js
Created May 14, 2011 18:37
simple script to randomly place scaled, rotated, color overlayed images on an html5 canvas. Might be helpful for creating dynamic header for web site
/*
* jebaird.canvasImageRandomizer - simple "framework" to randomly place scaled, rotated, color overlayed images on an html5 canvas
* Jesse Baird <jebaird@gmail.com>
* 5/14/2011
* Copyright 2011, Jesse Baird
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jebaird.com/blog/html5-canvas-image-randomizer
*
*
*