This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = function() { | |
this.state = 'pending'; | |
this.thenables = []; | |
}; | |
Promise.prototype.resolve = function(value) { | |
if (this.state != 'pending') { return; }; | |
this.state = 'fulfilled'; | |
this.value = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() ; |
NewerOlder