Skip to content

Instantly share code, notes, and snippets.

@piatra
piatra / app.js
Created June 7, 2012 08:59 — forked from max-mapper/app.js
github oauth with tako and leveldb
var path = require('path')
var tako = require('tako')
var gist = require('gist')
var request = require('request')
var qs = require('querystring')
var leveldb = require('leveldb')
var https = require('https')
var htmldir = path.resolve(__dirname, 'attachments')
@paulirish
paulirish / gist:2926904
Created June 13, 2012 22:31
My SublimeLinter.sublime-settings file
{
"// my options for SublimeLinter " : "//",
"jshint_options" : {
"boss": true,
"browser": true,
"curly": false,
"devel": true,
"eqeqeq": false,
"eqnull": true,
// create pub-sub functionality
Backbone.pubSub = _.extend({}, Backbone.Events);
// view one needs to trigger an event in view2
View1 = Backbone.View.extend({
triggerView2Event : function() {
Backbone.pubSub.trigger('view2event', { 'some' : 'data' } );
})
@shuhaowu
shuhaowu / relative_time.js
Last active October 12, 2015 07:48
Relative time helper like twitter in JavaScript
var relative_time = function(timestamp, relative_to) {
if (timestamp === null || timestamp === undefined)
return "";
var delta, relative_is_future, t;
if (!relative_to)
relative_to = parseInt(new Date().getTime() / 1000);
if ($.type(timestamp) !== "number")
@max-mapper
max-mapper / readme.md
Created December 6, 2012 20:50
hybrid app article topics
  • touch events to make web apps feel fast
  • default mobile css overrides (-webkit-touch-callout: none; etc)
  • using zepto to make mobile web apps
  • client side templating and routing for quick loading apps
  • supporting retina devices with sprites
  • css3 flexible box model and column layouts for responsive web apps
  • using phonegap to deploy web apps as native
  • web first development workflow (chrome dev tools, safari debugging)
  • how to submit a web app to the app store + google play
  • cross platform mobile code via feature detection
@max-mapper
max-mapper / readme.md
Last active June 3, 2020 00:31
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
<!DOCTYPE>
<html>
<head>
<title>Dissecting Gmail's Email Attachments - Dropping Files</title>
<style>
.msg {
display: none
}
.dragging .msg {
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@domenic
domenic / 1-Domenic.js
Last active September 30, 2021 15:43
How DI container config should work (in JS)
"use strict";
// Domenic needs a Tweeter
function Domenic(tweeter) {
this.tweeter = tweeter;
}
Domenic.inject = ["tweeter"];
Domenic.prototype.doSomethingCool = function () {
return this.tweeter.tweet("Did something cool!");