Skip to content

Instantly share code, notes, and snippets.

View vidware.sh
#!/bin/bash
# (c) https://www.raspberrypi.org/forums/viewtopic.php?t=199775
# Vidware_Downloads: My script philosophy is to keep things clean and simple.
# That's why my first step is to create 3 different folders to keep the main elements
# of my script completely separate from each other. Before anything can be built,
# we first have to download 6 files in the form of "stable release tarballs".
# This is the raw source code my script will use to build the 6 programs.
# We also need 4 GPU-related files from the Raspberry Pi Foundation's
@manast
manast / gist:6281219
Created Aug 20, 2013
app.js for todomvc in gnd.io
View gist:6281219
define(['gnd', 'models/todo', 'models/todoList', 'ctrls/todoListCtrl'],
function(Gnd, Todo, TodoList, TodoListCtrl){
'use strict';
//
// Create Local and Remote storages
//
var localStorage = new Gnd.Storage.Local();
//
View gist:6281205
define(['gnd', 'models/todo'], function(Gnd, Todo) {
'use strict';
return Gnd.Util.extend(Gnd.Base, function(_super) {
return {
constructor: function TodoListCtrl(collection) {
_super.constructor.call(this);
var _this = this;
this.set('collection', collection);
@manast
manast / gist:6281160
Created Aug 20, 2013
index.html of gnd.io todomvc example app
View gist:6281160
<!DOCTYPE html>
<html 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">
<meta name="fragment" content="!">
<title>Ground Application</title>
@manast
manast / gist:5775455
Created Jun 13, 2013
Continuable vs Promises
View gist:5775455
// ES6 syntax
var target = yield fs.readlink("/path/to/symlink");
// ES5 syntax
fs.readlink("/path/to/symlink")(function (err, target) {
if (err) throw err;
// do something with target
});
// Promised based
@manast
manast / interval.js
Last active Sep 21, 2021
Accurate Javascript setInterval replacement
View interval.js
function interval(duration, fn){
var _this = this
this.baseline = undefined
this.run = function(){
if(_this.baseline === undefined){
_this.baseline = new Date().getTime()
}
fn()
var end = new Date().getTime()