Skip to content

Instantly share code, notes, and snippets.

View chrisjacob's full-sized avatar

Chris Jacob chrisjacob

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
Test c
and a new line
here
and here
@chrisjacob
chrisjacob / README.md
Created July 16, 2011 11:23
How to: GitHub Pages "gh-pages" branch for User & Organization Pages

GitHub Pages "Normal" Setup for User & Organization Pages

Let’s say your GitHub username is “alice”. If you create a GitHub repository named alice.github.com, commit a file named index.html into the master branch, and push it to GitHub, then this file will be automatically published to http://alice.github.com/... The same works for organizations.

Read more here: http://pages.github.com/

However... the downside of this is that anyone that forks this repo won't get it as a GitHub Pages repo when they are working on it... because they have a different GitHub "username" (or "organisation name").

So the trick is to not use a master branch as the documentation tells you... rather, use a gh-pages branch, as you would for your other "Project Pages".

@chrisjacob
chrisjacob / index.php
Created July 13, 2011 07:41
Date Of Birth (DOB) Validation - PHP & JS pulled from a project - these snippets have not been tested on their own.
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="/js/jquery.validate.additional.js"></script>
<style>
li.error, label.error, p.error{color:#F00;}
#entryForm ol{list-style-type:none;}
#entryForm label{display:block; margin-top:6px;}
#entryForm label.error{margin-top:0px;}
</style>
@chrisjacob
chrisjacob / README.md
Created July 5, 2011 12:32
ViewSource.me - Starting a new viewsource.me.PROJECT repository.

Global .gitignore

We don't want to polute the repository with a .gitignore file... so you must add common OS files to your Global .gitignore. If you don't already have a global .gitignore then follow the instructions below (from: http://help.github.com/ignore-files/) or skip to the next section.

cd ~   
touch .gitignore_global   
mate .gitignore_global   
@chrisjacob
chrisjacob / gem
Created June 10, 2011 00:58 — forked from shanaver/gem
installing the mysql gem on Snow Leopard with MAMP - mileage may vary - verify the locations of your respective files first
gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
OR
bundle config build.mysql --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
@chrisjacob
chrisjacob / email_validation.php
Created May 31, 2011 02:47
PHP Email Validation
<?php
const VALID_EMAIL = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2}|aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel)$/i';
function validateEmail( $email )
{
if ( !preg_match(VALID_EMAIL, $email) )
{
return false;
}
<b>wow</b>
Wish!
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="test">
Test this
</div>
</body>
</html>
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text