Skip to content

Instantly share code, notes, and snippets.

<link rel="import" href="../components/polymer/polymer.html">
<link rel="import" href="/components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#core_drawer_panel {
position: absolute;
top: 620px;
var lab_data = nio.src.socketio('http://54.197.236.34:443')('lab');
function digitalSensor(selector, on_text, off_text) {
var el = d3.select(selector);
return _.assign({}, nio._streamer, {
write: function (data) {
if (data == 'on') {
el.selectAll('.status').html(on_text);
el.attr('status', 'on');
request = require 'request'
_ = require 'lodash'
Nightmare = require 'nightmare'
nightmare = new Nightmare()
findImages = (link) ->
nightmare
.goto link
.wait()
#.evaluate getImages, logImages
package main
import "honnef.co/go/js/console"
func main() {
console.Log("hello")
}
@liamcurry
liamcurry / Testing.html
Created November 2, 2009 23:07
chapter1.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Coddee</title>
<link rel="stylesheet" href="stylesheets/master.css" />
</head>
<body id="tutorial">
<div id="layout-header">
<h1>coddee</h1>
@liamcurry
liamcurry / gist:441595
Created June 17, 2010 02:25
Introduction to HTML
We couldn’t find that file to show.
@liamcurry
liamcurry / models.py
Created May 5, 2011 14:58
Django Snippets
from django.db import models
class TimeAwareModel(models.Model):
created_on = models.DateTimeField(editable=False, auto_now_add=True)
updated_at = models.DateTimeField(editable=False, auto_now=True)
class Meta:
abstract = True
@liamcurry
liamcurry / index.html
Created June 10, 2011 16:13
HTML Boilerplate
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<title></title>
<meta name='description' content=''>
<meta name='author' content=''>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel='stylesheet' type='text/css' href='css/master.css' />
@liamcurry
liamcurry / gist:1019779
Created June 10, 2011 21:06
Add embedded document helpers to Mongoose.js
mongoose.Types.DocumentArray.prototype.sortByDir = function(direction, path) {
this.sort(function(a, b) {
var aVal = a.get(path),
bVal = b.get(path);
if (!aVal && !bVal) return 0;
if (!aVal) return 1;
if (!bVal) return -1;
if (direction > 0) return !(aVal < bVal);
return (aVal < bVal);
});
@liamcurry
liamcurry / develop.py
Created September 18, 2011 19:53
Start coffee, compass, and a simple HTTP server with one script
#!/usr/bin/python
import os
import subprocess
import signal
import sys
STATICGEN_ROOT = (os.path.join(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))),
'staticgen'))
staticgen_path = lambda *a: os.path.abspath(os.path.join(STATICGEN_ROOT, *a))