Skip to content

Instantly share code, notes, and snippets.

View dalmaer's full-sized avatar

Dion Almaer dalmaer

View GitHub Profile
var palette = require('./')
, fs = require('fs')
, Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas
, ctx = canvas.getContext('2d')
, path = process.argv[2]
, out = '/tmp/out.png';
if (!path) {
section {
position: relative;
margin-top: -140px;
}
p, p:before {
position: absolute;
top: 0;
left: 0;
-webkit-box-reflect: below -120px -webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0)50%,rgba(0,0,0,0.75))
$(document).ready(function() {
$(document).mousemove(function(e) {
var horizontal = e.pageX / $(document).width();
var vertical = e.pageY / $(document).height();
$('.ipad').css({
'-webkit-transform': 'rotateX(' + (7 - (vertical * 14)) + 'deg) rotateY(' + ( - 10 + (horizontal * 20)) + 'deg)'
});
$('.specular').css({
// Remove the image views that cause shadow on the overscroll
// Based on: http://stackoverflow.com/questions/1074320/remove-uiwebview-shadow
NSArray *subViews = [webView subviews];
if ([subViews count] > 0) {
for (UIView* aView in [[subViews objectAtIndex:0] subviews]) {
if ([aView isKindOfClass:[UIImageView class]]) {
[aView setHidden:YES];
}
}
}
# in and out
average :: ({name: Str, age: Num}, [...Num]) -> Str
average = (person, loc) ->
sum = loc.reduce (s1, s2) -> s1 + s2
"#{person.name} wrote on average
#{sum / loc.length} lines of code."
# using your own functions to enforce (just need to handle true or false)
Even = (x) -> x % 2 is 0
Odd = (x) -> x % 2 isnt 0
html = b.html {
b.head {
b.title "XML Builder Test"
}
b.body {
b.h1 "Title of Page"
b.p "Sample paragraph text"
}
}
w.html()
.head().title().text("Example & Test").xtitle().xhead()
.body().text("Hello world!").xbody()
.xhtml();
/* simple */
document.body.appendChild(
Fox.makeTable([
"+---+---+---+",
"|A |B |C |",
"| +---+---+",
"| |D |E |",
"| +---+ |",
"| |F | |",
"+---+---+---+",
$('#forward').click(function() {
$('#test').animate({
translateX:'-=150',
translateY:'+=150',
scale:'+=2',
rotateY: '+='+(2*Math.PI),
rotateX: '+='+Math.PI,
rotateZ: '+='+Math.PI
}, 1500);
});
<!DOCTYPE html>
<html>
<head>
<title>Android Style</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<style type="text/css">
input[type=radio] {