This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<body> | |
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({appId: '389030183265', status: true, cookie: true, | |
xfbml: true}); | |
}; | |
(function() { | |
var e = document.createElement('script'); e.async = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some simple webkit 3d extensions to jQuery | |
// Use safari 5 to view. | |
// (you need to set the -webkit-perspective CSS property to something on the element containing #myNiceDiv for this to work) | |
// Example use: | |
// Rotate a div on Y an Z axis: | |
// $("#myNiceDiv").rotate(0, 30, 10); | |
// Move the div closer to the camera | |
// $("#myNiceDiv").translate(0, 0, 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<script> | |
$(document).ready(function() { | |
window.fbAsyncInit = function() { | |
FB.init({appId: '132860020070788', status: true, cookie: true, xfbml: true}); | |
FB.Event.subscribe('edge.create', function(href, widget) { | |
// Tell Google Analytics that we had a like! | |
_gaq.push(['_trackEvent', 'FacebookLikes', 'Root', 'Like of Root Page']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
JUMPYFIELD is a simple little thing that makes the focus jump between fields when they reach maxlength. | |
Usage: | |
$(".myInputFields").jumpy(); | |
jumpy also accepts an optional array of default values that count the fields as "empty". Example: | |
$(".myInputFields").jumpy(["YY","MM","DD"]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JayCutCommandFactory | |
attr_accessor :site_name, :key, :secret, :api_host_base | |
def initialize(site_name, key, secret) | |
@site_name = site_name | |
@key = key | |
@secret = secret | |
@api_host_base = "api.jaycut.com" | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script accepts one or more directories and find all .as and .mxml files in them, and extracts | |
# gettext marked strings from them. It also finds string that are NOT marked with gettext, and puts | |
# them in a separate file, for easy finding of strings that we have missed to internationalize. | |
# create a list of all .as and .mxml files and put the list into files4i18n | |
find $* | egrep -i '\.as$|\.mxml$' > files4i18n | |
echo "Extracting marked strings and putting them into template.pot" | |
xgettext -f files4i18n --keyword=LC:1c,2 --from-code=UTF-8 -o template.pot --add-comments='TRANSLATOR' --language=python | |
# We parse as python, since there is no offical support for ActionsScript. This works, with the minor exception that it won't |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# handy little script i wrote to compress the enourmous image folder my girlfriend had, | |
sudo port install ImageMagick | |
find . -type f -name '*.jp*' -exec mogrify -resize '1280>' -compress jpeg -quality 85 {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SOME DESCRIPTIVE TITLE. | |
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |
# This file is distributed under the same license as the PACKAGE package. | |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | |
# | |
#, fuzzy | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: PACKAGE VERSION\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os, traceback, optparse | |
import polib | |
from xml.dom.minidom import Document | |
import time | |
import re | |
#from pexpect import run, spawn | |
def main (): | |
doc = Document() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function on_file_input_element_changed() { | |
var my_file_input_element = my_method_to_find_file_input_element(); | |
var file = my_file_input_element.files[0]; | |
var xhr = new XMLHttpRequest(); | |
var is_async = true; | |
xhr.open("POST", "/upload", is_async); | |
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); | |
xhr.setRequestHeader("X-File-Name", encodeURIComponent(file.fileName)); | |
xhr.setRequestHeader("Content-Type", "application/octet-stream"); |