Skip to content

Instantly share code, notes, and snippets.

var time = 60000/360, init = 0, per = 2*Math.PI/360;
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.arc(100,75,50,0,0*Math.PI);
ctx.stroke();
import commands
def get_cpu_temp():
tempFile = open( "/sys/class/thermal/thermal_zone0/temp" )
cpu_temp = tempFile.read()
tempFile.close()
return float(cpu_temp)/1000
# Uncomment the next line if you want the temp in Fahrenheit
#return float(1.8*cpu_temp)+32
var TemplateEngine = function(html, options) {
var re = /<%([^%>]+)?%>/g,
reExp = /(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,
code = 'var r=[];\n',
cursor = 0;
var add = function(line, js) {
js? (code += line.match(reExp) ? line + '\n' : 'r.push(' + line + ');\n') :
(code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : '');
return add;
var Promise = function() {
this.state = 'pending';
this.thenables = [];
};
Promise.prototype.resolve = function(value) {
if (this.state != 'pending') { return; };
this.state = 'fulfilled';
this.value = value;
@lolocoo
lolocoo / Gruntfile.js
Created April 3, 2014 05:23
grunt files init 20140403
/*global module:false*/
module.exports = function(grunt) {
var conf, pkg;
pkg = grunt.file.readJSON('package.json');
conf = {
src: 'app',
host: '0.0.0.0',
port: 9000,
livereload: 35729
if ($.inArray('old', clsName) == 1 || $.inArray('new', clsName) == 1) {
html.push('<td></td>');
} else {
html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
}
var event_dates = ['2014-03-01','2014-03-02'];
// console.log(prevMonth.getUTCFullYear());
var s = prevMonth.getUTCFullYear() + '/' + prevMonth.getUTCMonth() + '/' + prevMonth.getUTCDate() ;