Skip to content

Instantly share code, notes, and snippets.

View manast's full-sized avatar

Manuel Astudillo manast

View GitHub Profile
@manast
manast / vidware.sh
Last active December 24, 2018 11:58
#!/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 August 20, 2013 13:13
app.js for todomvc in gnd.io
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();
//
@manast
manast / gist:6281205
Created August 20, 2013 13:12
todoListCtrl
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 August 20, 2013 13:10
index.html of gnd.io todomvc example app
<!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 June 13, 2013 17:07
Continuable vs Promises
// 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 November 15, 2023 22:08
Accurate Javascript setInterval replacement
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()