This file contains 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
/* | |
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !! | |
Highlights arbitrary terms. | |
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html> | |
MIT license. |
This file contains 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
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |
This file contains 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
var socket = null; | |
function bootstrap() { | |
// 適当な図形を描画 | |
var c = document.getElementById('mycanvas'); | |
var ctx = c.getContext('2d'); | |
ctx.globalalpha = 0.3; | |
for(var i=0; i<1000; i++) { | |
ctx.beginPath(); |
This file contains 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
<!DOCTYPE html> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |
This file contains 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($){ | |
var convertTableToJson = function() | |
{ | |
var rows = []; | |
$('table tr').each(function(i, n){ | |
var $row = $(n); | |
rows.push({ | |
display_name: $row.find('td:eq(0)').text(), | |
first_name: $row.find('td:eq(1)').text(), | |
last_name: $row.find('td:eq(2)').text(), |
This file contains 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
CODESWARM_DIR="/home/user/src/code_swarm/" | |
# extract from your git repo | |
git log --name-status --pretty=format:'%n------------------------------------------------------------------------%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > $CODESWARM_DIR/data/activity.log | |
# convert to XML for CodeSwarm | |
python convert_logs/convert_logs.py \ | |
-g $CODESWARM_DIR/data/activity.log -o $CODESWARM_DIR/data/activity.xml | |
# create a new config that points to the correct input XML and saves snapshots |
This file contains 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> | |
<head> | |
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
<script src="strophe-102.js" type="text/javascript"></script> | |
<script src="facebook.js" type="text/javascript"></script> | |
<script> | |
var BOSH_SERVICE = 'http://island.csie.org:8273/xmpp-httpbind' | |
var connection = null; |
This file contains 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
var gulp = require('gulp'); | |
var clean = require('gulp-clean'); | |
var jshint = require('gulp-jshint'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var imagemin = require('gulp-imagemin'); | |
var bases = { | |
app: 'app/', |
This file contains 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
var fb = new DSFirebaseAdapter({ | |
basePath: 'https://my-app.firebase.io' | |
}); | |
var ls = new DSLocalStorageAdapter(); | |
var store = new JSData.DS({ | |
// try firebase first, otherwise try offline data | |
fallbackAdapters: ['fb', 'ls'], | |
// After creating an item, sync it to localStorage |
This file contains 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
var store = new JSData.DS(); | |
function FakeAdapter() { | |
var data = {}; | |
function addMetaForResource(resource) { | |
if (resource.name !== data) { | |
data[resource.name] = {}; | |
data[resource.name].curId = 1; | |
data[resource.name].index = {}; |
OlderNewer