Skip to content

Instantly share code, notes, and snippets.

View ayoungh's full-sized avatar
:octocat:
Coffee and code

Anthony Young ayoungh

:octocat:
Coffee and code
View GitHub Profile
@ayoungh
ayoungh / dabblet.css
Created February 1, 2012 22:13 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;
@ayoungh
ayoungh / Python grab page
Created June 21, 2012 15:55
Grab page in python
from urllib import urlopen
doc = urlopen("http://www.python.org").read()
print doc
@ayoungh
ayoungh / index.html
Created December 13, 2012 13:54
A CodePen by Anthony Young. Awesome textarea - A really nice textarea with a background colour change on focus
<h2>Awesome Textarea</h2>
<textarea placeholder="This is an awesome comment box" rows="20" name="comment[text]" id="comment_text" cols="40" class="ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true"></textarea>
@ayoungh
ayoungh / gist:4636460
Created January 25, 2013 17:51
Preload background images
/* Preload images */
       var images = ['/images/contentbg.jpg','/images/scrollbtn.gif','/images/cross.png','/images/sidebar_top_gradient.jpg','/images/bulletpointdown.gif'],
           image_obj = new Image();
       for (var image=0; image<images.length; image++) {
           image_obj.src = images[image];
       }
{
"name": "wordpress-starter-theme",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.2.0",
"grunt-contrib-imagemin": "~0.1.4",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-uglify": "~0.2.0",
@ayoungh
ayoungh / day-of-week.js
Created July 1, 2014 14:20
Day Of Week JS
function theDay () {
var thedate = new Date();
var weekday = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var dayofweek = weekday[thedate.getDay()];
return dayofweek;
};
@ayoungh
ayoungh / Exit-Intention-JS.markdown
Created October 2, 2014 08:28
A Pen by Anthony Young.
@ayoungh
ayoungh / ep_app.js
Last active August 29, 2015 14:26 — forked from focusaurus/ep_app.js
Example of how a main express app can mount sub-applications on a mount point with app.use('/mount-point', subapp); If you GET /, you'll see the main_app's '/' response. If you GET /ep_app, you'll see the ep_app's '/' response.
var express = require("express");
var app = express();
app.get('/', function (req, res) {
res.send("This is the '/' route in ep_app");
});
module.exports = app;
@ayoungh
ayoungh / basic_auth_nodejs_test.js
Created March 29, 2016 09:24 — forked from charlesdaniel/basic_auth_nodejs_test.js
Example of HTTP Basic Auth in NodeJS
var http = require('http');
var server = http.createServer(function(req, res) {
// console.log(req); // debug dump the request
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object)
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64
console.log("Authorization Header is: ", auth);
### Keybase proof
I hereby claim:
* I am ayoungh on github.
* I am ayoungh (https://keybase.io/ayoungh) on keybase.
* I have a public key whose fingerprint is 70FB CBD8 931C 46B3 2C77 3FBA ECDD 4804 6CFB 2FEC
To claim this, I am signing this object: