This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 { | |
2 "name": "...", | |
3 "version": "1.0.0", | |
4 "description": "...", | |
5 "main": "index.js", | |
6 "scripts": { | |
7 "build:css": "stylus --compress ../lib/.../index.styl --out dist/....css", | |
8 "watch:css": "stylus --watch ../lib/.../index.styl --out dist/....css", | |
9 "build:js": "browserify ../lib/.../standalone.js --standalone bootstrap > dist/....js", | |
10 "watch:js": "watchify ../lib/.../standalone.js --standalone bootstrap -o dist/....js", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local application = require "hs.application" | |
local tiling = require "hs.tiling" -- git clone https://github.com/dsanson/hs.tiling $HOME/.hammerspoon/hs/tiling | |
local hotkey = require "hs.hotkey" | |
-- http://www.tenshu.net/p/fake-hyper-key-for-osx.html | |
local alt = {"⌥"} | |
local hyper = {"⌘", "⌥", "⌃", "⇧"} | |
local safari = nil | |
-- settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var m = require('mithril'); | |
var icons = require('client/utils/icons'); | |
var remove = require('lodash/array/remove'); | |
var transform = require('lodash/object/transform'); | |
var last = require('lodash/array/last'); | |
var code = require('yields-keycode'); | |
function sameAs(filterA) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
function createView(ctrl, opts, children) { | |
return m('h1', 'Cached') | |
} | |
function controller() { | |
return { | |
view: m.prop() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Contacts = { | |
controller: function() { | |
var contacts = [{name: 'Peter'}] | |
var contact = contacts[m.route.param] | |
return { | |
contact: contact | |
} | |
}, | |
view: function(controller) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @module video | |
* @description | |
* Video player | |
*/ | |
'use strict' | |
function controller(opts) { | |
var type, link, options, videoID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var login = { | |
controller: function(opts, children) { | |
var backend | |
opts = opts || {} | |
backend = opts.backendUrl || 'accounts.yahoo.com' | |
return { | |
submit: function() { | |
m.request(backend, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var test = {}; | |
test.getnews = function(exa) { | |
return m.request({ | |
method: 'GET', | |
dataType: "jsonp", | |
url: "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&q=" + exa, | |
unwrapSuccess: function(response) { | |
return response.responseData.feed.entries; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This code uses a regular expression to make the json safer. | |
An potentially safer alternative is https://github.com/joewalnes/filtrex (untested) at the cost of 130Kb. | |
Can be used for example with this JSON structure: | |
{ | |
"_meta_po_header": "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);", | |
"COLLECTION_CONTENTS[0]": "Kolekcja zawiera %@ przepis.", | |
"COLLECTION_CONTENTS[1]": "Kolekcja zawiera %@ przepisy.", | |
"COLLECTION_CONTENTS[2]": "Kolekcja zawiera %@ przepisów." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pluck = require("lodash").pluck | |
var groupBy = require("lodash").groupBy | |
var forceRender = require("lodash").identity | |
var m = require("mithril") | |
var horsey = require("horsey") | |
var controller = function(label, data, property){ | |
//split the data set into subsets for performance |