Skip to content

Instantly share code, notes, and snippets.

View lusentis's full-sized avatar

Simone Lusenti lusentis

View GitHub Profile
@lusentis
lusentis / router.coffee
Created June 24, 2012 12:31
RouterJS - A framework-independent BrowserJS routing and m[vc] lib
###
RouterJS - A framework-independent BrowserJS routing and m[vc] lib
Dependencies: RequreJS for loading, Handlebars for templates, jQuery for ajax and selectors
Part of Plee.co Frontend
(c) 2012 PlasticPanda.com
~ relying solely on what’s been done in the past
@lusentis
lusentis / xselect.coffee
Created June 26, 2012 08:50
x-select custom tag
###
PandaSelect - replaces HTML selects
Dependencies: RequreJS for loading, jQuery for selectors
Part of Plee.co Frontend
(c) 2012 PlasticPanda.com
~ relying solely on what’s been done in the past
@lusentis
lusentis / pandapicker.coffee
Created June 27, 2012 16:00
Plasticpanda Date Picker
# PlasticPanda.com - Date Picker
## cofigurable parameters
cssPrefix = 'pandapicker-'
template_html = """
<table role="datepicker">
<thead>
<tr>
@lusentis
lusentis / randpass.jade
Created June 30, 2012 19:24
Browser-JS random password generator applet
//- A general purpose not-so-random string generator
//- This file is in public domain
//- by Simone Lusenti - PlasticPanda.com, 2012
doctype 5
html
head
meta(charset='utf-8')
meta(name='Content-Type', value='text/html')
title Random pass generator
routes = [
['/profile/', 'my_profile']
['/login/', 'login']
['/logout/', ['User', 'logout']]
['/upload/', 'show_upload']
['/docs/', 'my_docs']
]
define ['router', 'text!templates/document.html'], (routerjs, template_doc) ->
class Document extends routerjs.SyncModel
url: '/document/' # API end point
template: template_doc # HTML Template to render when fetching data with @get
Document.mine = (callback) ->
@req 'mine/', 'GET', {}, callback
@lusentis
lusentis / gist:3892003
Created October 15, 2012 11:20
Epson TM-T88 serial python
# -~- coding: utf-8 -~-
## not working write
import serial
import sys
import StringIO
def fp81_write(s, payload):
@lusentis
lusentis / grunt.js
Created October 20, 2012 15:46
Grunt min task with support for minification without concatenation (one-to-one)
//.....
min: { // for production
vendor: {
src: ['public/js/vendor/*.js'],
dest: 'public_build/js/vendor.js',
separator: ';'
},
app: {
src: ['public/js/*.js'],
destDir: 'public_build/js/',
@lusentis
lusentis / objectstorage.js
Last active October 12, 2015 04:08
Object storage support for HTML5 Storage
/*global Storage:false */
/*jshint eqnull:true */
/*
* Extends Storage object to support storing JSON-encoded objects.
* (c) 2012 PlasticPanda.com
* License: MIT
*/
(function (Storage) {
@lusentis
lusentis / .gitconfig
Created November 17, 2012 15:38
Git hooks and scripts for production deployment (Python only at the moment)
# add this line:
[receive]
denyCurrentBranch = warn