Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
@easierbycode
easierbycode / index.html
Last active August 29, 2015 14:00
1.0 doesn't mean stable
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<drawing t="translate(0,31)">
<line stroke="green">
@easierbycode
easierbycode / 0_reuse_code.js
Created July 5, 2014 05:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
exports.sensorHubEvent = (sensorHubEvent, eventResolved) ->
alertText = switch sensorHubEvent
when 1 then 'Water detect'
when 2 then 'Motion detect'
when 3 then 'Low temperature'
when 4 then 'High temperature'
when 5 then 'Low humidity'
when 6 then 'High humidity'
when 7 then 'Low light'
when 8 then 'High light'
formatted = {
prefix: 'HC2',
sequenceNumber: '0100',
networkHubMAC: '533F15800700',
action: '01',
sensorHubMAC: '103E15800700',
nbrOfBytes: '10',
temperatureMax: '2000',
temperatureMin: '0000',
lightMax: 'ffff',
{
sequenceNumber: '0100',
networkHubMAC: '533F15800700',
action: '01',
sensorHubMAC: '103E15800700',
nbrOfBytes: '10',
temperatureMax: '2000',
temperatureMin: '0000',
lightMax: '8403',
lightMin: '0100',
# A program to print a receipt after gas is pumped
# Import statements
import datetime
# Global variable declaration
numberOfGallons = 13.000
costPerGallon = 2.05
totalCost = numberOfGallons * costPerGallon
stationName = "Chevron"
fields = switch req.query.msgType
when '0' then ['timestamp', 'macAddress', 'gatewayBattery', 'rssi']
when '2' then ['timestamp', 'macAddress', 'gatewayBattery', 'gatewayEventCode', 'rssi']
when '4' then ['timestamp', 'macAddress', 'sensorEventStart', 'sensorEventEnd', 'rssi', 'sensorHubBattery', 'sensorHubMacAddress', 'sensorHubRssi']
when '5' then ['timestamp', 'macAddress', 'rssi', 'numberOfSensors', 'sensorHubBattery', 'sensorHubData1', 'sensorHubData2', 'sensorHubData3', 'sensorHubMacAddress', 'sensorHubRssi', 'sensorHubType']
@easierbycode
easierbycode / chat.html
Created October 27, 2011 17:44 — forked from JoeyButler/chat.html
Simple Chat app
<!DOCTYPE html>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script>
$(document).ready(function(){
function debug(str){ $("#debug").append("<p>"+str+"</p>"); };
if(typeof WebSocket === 'undefined') {
alert("Your browser does not support websockets.")
}
/**
* Render templates.
*
* @param {String} The template to use `<p>Hello {{name}}</p>`
* @param {String} The data `{ name: 'Alex' }`
* @return {String} The rendered template
**/
function template(t, d) {
return t.replace(/{{([^}]*)}}/g, function(m, f, p, a) {
return d[f] || '';
@easierbycode
easierbycode / timeout.js
Created December 22, 2011 01:24 — forked from mxriverlynn/timeout.js
Timeout
Foo = {};
Foo.bar = function(){
alert("test");
}
setTimeout(Foo.bar, 1000); // 1 second later, alert's "test"