Skip to content

Instantly share code, notes, and snippets.

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() ;
@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
var Promise = function() {
this.state = 'pending';
this.thenables = [];
};
Promise.prototype.resolve = function(value) {
if (this.state != 'pending') { return; };
this.state = 'fulfilled';
this.value = value;
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;
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 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();
@lolocoo
lolocoo / persistant-header.html
Created December 13, 2016 00:24
persistant-header
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Table with Persistent Headers</title>
<link rel="stylesheet" href="css/style.css">
https://github.com/emmetio/emmet-atom/issues/354
@lolocoo
lolocoo / sui-offcanvas
Created February 25, 2017 00:32
sui-offcanvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>我的生活</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@lolocoo
lolocoo / gulpfile.js
Created March 1, 2017 01:00
tencent gulp file
var gulp = require('gulp');
// sass 插件
var sass = require('gulp-sass');
// 自动同步浏览器插件
var browserSync = require('browser-sync');
// 合并文件的插件
var useref = require('gulp-useref');
// 压缩js插件
var uglify = require('gulp-uglify');
var gulpIf = require('gulp-if');