Skip to content

Instantly share code, notes, and snippets.

View chrisjacob's full-sized avatar

Chris Jacob chrisjacob

View GitHub Profile
@chrisjacob
chrisjacob / charCode-encode-string.js
Created June 1, 2010 17:41
string2charCodeString encodes the entire string to charCode values. idEncode converts a string into a valid HTML id attribute [A-Za-z0-9_-]. Useful for producing readable window.location.hash fragments
// Example:
// http://github.com/chris/project123/blob/master/new_mailer/install-file.rb
// 104-116-116-112-58-47-47-103-105-116-104-117-98-46-99-111-109-47-99-104-114-105-115-47-112-114-111-106-101-99-116-49-50-51-47-98-108-111-98-47-109-97-115-116-101-114-47-110-101-119-95-109-97-105-108-101-114-47-105-110-115-116-97-108-108-45-102-105-108-101-46-114-98
function string2charCodeString (s){
if(typeof(s) != 'string') return false;
a = [];
f = s.length;
for (i = 0; i<f; i++) {
a[i] = s.charCodeAt(i);
/* Handy CSS Debugging Snippet
* { outline: 2px dotted red }
* * { outline: 2px dotted green }
* * * { outline: 2px dotted orange }
* * * * { outline: 2px dotted blue }
* * * * * { outline: 1px solid red }
* * * * * * { outline: 1px solid green }
* * * * * * * { outline: 1px solid orange }
* * * * * * * * { outline: 1px solid blue }
*/

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@chrisjacob
chrisjacob / bar.txt
Created November 18, 2010 13:57
Testing public gist access
Bar
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@chrisjacob
chrisjacob / fiddle.html
Created January 12, 2011 16:07
XHTML5 using .xhtml and .html extensions
<!DOCTYPE html>
<!-- See http://mathiasbynens.be/notes/xhtml5 for more info. -->
<!-- This document is served as application/xhtml+xml to trigger HTML5 in XML serialization mode. -->
<!-- The DOCTYPE is optional in XML mode, but if you don't want to omit it, it needs to be uppercase. -->
<!-- Also, you need to add an XML namespace to the root element. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>XHTML5, or HTML5 in XML serialization mode</title>
</head>
@chrisjacob
chrisjacob / Test.md
Created January 14, 2011 05:59
Test md

test this

#!/bin/sh
#
# Post-update hook to checkout working copy and publish it with jekyll
#
# To enable this hook, make this file executable by "chmod +x post-update".
git-update-server-info
is_bare=$(git-config --get --bool core.bare)
@chrisjacob
chrisjacob / sitemap.xml
Created February 3, 2011 16:28
cldwalker.github.com / sitemap.xml
---
layout: nil
site_pages:
- /
- /about.html
- /projects.html
- /blog.html
- /hirb/
- /has_machine_tags/
- /console_update/
# TextMate dotfiles filter
# use this filter in Preferences -> Advanced -> Folder References -> File Pattern
# to show .gitignore, .gems (useful for Heroku), .bundle in your project
!(/\.(?!(htaccess|gitignore|gems|bundle))[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$