Skip to content

Instantly share code, notes, and snippets.

View sethladd's full-sized avatar

Seth Ladd sethladd

View GitHub Profile
@sethladd
sethladd / addgoogleplusonecode.js
Created June 6, 2011 04:12
Tweets +1 Chrome Extension for Google +1 Button and twitter.com
var plusOneScript = document.createElement('script');
plusOneScript.setAttribute("src", "https://apis.google.com/js/plusone.js");
plusOneScript.textContent = '{"parsetags": "explicit"}';
plusOneScript.addEventListener("load", function() {
var script = document.createElement("script");
script.textContent = "var addPlusOne = function(){gapi.plusone.go();setTimeout(addPlusOne, 1000);};setTimeout(addPlusOne, 1000);";
document.body.appendChild(script);
}, false);
document.body.appendChild(plusOneScript);
function Timer() {
this.gameTime = 0;
this.lastTick = 0;
this.maxStep = 0.05;
this.lastTimestamp = 0;
}
Timer.prototype.step = function() {
var current = Date.now();
@sethladd
sethladd / index.html
Created November 2, 2010 20:03
host html file for flash app for chrome web store packaged app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body style="overflow:hidden">
<embed width="100%" height="99%" src="main.swf" type="application/x-shockwave-flash"></embed>
</body>
@sethladd
sethladd / appcache.manifest
Created October 28, 2010 05:39
Example App Cache manifest file which caches resources locally to be used offline.
CACHE MANIFEST
CACHE:
index.html
pattern8-pattern70c.png
swfobject.js
chromelogo-pulse.swf
NETWORK:
@sethladd
sethladd / manifest.json
Created October 28, 2010 05:35
An example manifest.json for a Hosted Flash Web App.
{
"name": "Chrome is Glowing",
"description": "Try to take your eyes off of the glowing Chrome orb.",
"version": "1",
"app": {
"urls": [
"http://glowingchrome.appspot.com/"
],
"launch": {
"web_url": "http://glowingchrome.appspot.com/"
@sethladd
sethladd / manifest.json
Created October 28, 2010 05:11
A manifest for a packaged bare-bones Flash app for the Chrome Web Store. As simple as it gets.
{
"name": "YOUR APP NAME",
"description": "YOUR APP DESCRIPTION",
"version": "1",
"app": {
"launch": {
"local_path": "index.html"
}
},
"icons": {
{
"kind": "chromewebstore#license",
"id": "ejbknjbccnnccddiljheadjafeeagcan/https://www.google.com/accounts/o8/id?id\u003dAItOawlh_ZYIBQi-kNV-d3Rd8WIjQEBsLDh5LDQ",
"appId": "ejbknjbccnnccddiljheadjafeeagcan",
"userId": "https://www.google.com/accounts/o8/id?id\u003dAItOawlh_ZYIBQi-kNV-d3Rd8WIjQEBsLDh5LDQ",
"result": "YES",
"accessLevel": "FREE_TRIAL"
}
@sethladd
sethladd / .bash_profile
Created March 14, 2010 08:55 — forked from aeden/gist:331864
.bash_profile
export PATH=$PATH:/Users/sladd/.gem/ruby/1.8/bin
alias gst='git status '
alias gc='git commit '
alias gca='git commit -a '
alias ga='git add '
alias gco='git checkout '
alias gb='git branch '
alias gm='git merge '
alias gp='git push '
@sethladd
sethladd / check_wordpress_blogger_links.rb
Created March 10, 2010 06:47
Migrate from Wordpress to Blogger
@sethladd
sethladd / display git branch on prompt.sh
Created October 16, 2009 07:53
display git branch on prompt
parse_git_branch (){
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1='\[\033[0;33m\]\w\[\033[00m\]\[\033[01;00m\]$(parse_git_branch): '