Skip to content

Instantly share code, notes, and snippets.

@marsch
marsch / main.js
Created August 8, 2011 16:33
main.js
function showMore() {
document.getElementById("more-text").hidden = false;
}
alert("heheh");
@marsch
marsch / server.js
Created October 1, 2011 10:14
c9.io demo
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
@marsch
marsch / main.js
Created February 19, 2012 23:18
find permutations to a telefphone number
var map = {0: ' ', 1: '.', 2: 'abc', 3: 'def', 4: 'ghi', 5: 'jkl', 6: 'mno', 7: 'pqrs', 8:'tuv', 9:'wxyz'};
var number = 4878366;
var out = '';
var endl = '\n';
function getPerms(num, str, map) {
if (num == 0) {
out += str + endl;
} else {
@marsch
marsch / autocite.json
Created April 17, 2012 15:56
just dummy files for easybib-ffplugin
{
"status":"ok",
"data":{
"data":{
"pubonline":{
"title":"Wikipedia",
"day":"",
"month":"",
"year":"",
"inst":"Wikimedia Foundation",
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = simple
XPI_NAME = simple
LIBRARY_NAME = simpletest
<div data-extgroup="section" data-extid="head">
<div class="control-group">
<div class="controls">
<label for="{{=it.uid}}_title">{{= it.strings.SUBJECT }}</label>
<input type="text" class="discreet title" name="title" id="{{=it.uid}}_title"/>
</div>
</div>
<div class="control-group">
<div class="controls">
<label for="{{=it.uid}}_location">{{= it.strings.LOCATION }}</label>
<days>
<dayContext type="format">
<dayWidth type="abbreviated">
<day type="sun">Sun</day>
<day type="mon">Mon</day>
<day type="tue">Tue</day>
<day type="wed">Wed</day>
<day type="thu">Thu</day>
<day type="fri">Fri</day>
<day type="sat">Sat</day>
@marsch
marsch / microdata-version.html
Created August 25, 2012 23:06
rdfa lite vs. microdata
<div itemscope itemtype="http://schema.org/Product">
<img itemprop="image" src="dell-30in-lcd.jpg" />
<span itemprop="name">Dell UltraSharp 30" LCD Monitor</span>
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">87</span>
out of <span itemprop="bestRating">100</span>
based on <span itemprop="ratingCount">24</span> user ratings
</div>
@marsch
marsch / gist:4232288
Created December 7, 2012 10:10
options.check method
options.check = (composition) ->
if composition.type is type
if _(composition.params).isEqual options.params
return true
else if composition.params?.forceInit
# so the view will be re-initialized everytime
return false
else
# trigger an event in the view that params have changed
# so views can handle the change on there own