This file contains 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
# | |
# Hi all, | |
# this is the Python code I used to make the visualization "Temperature circle" | |
# (https://twitter.com/anttilip/status/892318734244884480). | |
# Please be aware that originally I wrote this for my tests only so the | |
# code was not ment to be published and is a mess and has no comments. | |
# Feel free to improve, modify, do whatever you want with it. If you decide | |
# to use the code, make an improved version of it, or it is useful for you | |
# in some another way I would be happy to know about it. You can contact me | |
# for example in Twitter (@anttilip). Unchecked demo data (no quarantees) |
This file contains 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 $el = $('.'+element.attr('class')), | |
anchors = $el.find('.navbar-right'); | |
// this is a symptom of the SVG api combined w/ bootstrap's plugin, | |
// recommending swapping bootstrap w/ a custom directive and/or using an ng-click | |
// on the affected elements | |
anchors.on('click', function(e) { | |
var target = $(e.target), | |
actualTarget; | |
if (typeof target[0].correspondingUseElement === 'undefined') { return; } |
This file contains 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
// lookup the store | |
store = OC2.__container__.lookup('store:main'); | |
// add a serializer to handle our embedded records | |
// ...either I'm getting this wrong or this is a bug, | |
// as I can't get this part to work | |
OC2.ColorSerializer = DS.ActiveModelSerializer.extend(DS.EmbeddedRecordsMixin, { | |
attrs: { | |
foos: {embedded: 'always'} | |
} |
This file contains 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
// lookup the store | |
store = OC2.__container__.lookup('store:main') | |
// Models | |
OC2.Color = DS.Model.extend({ | |
color: DS.attr(), | |
foos: DS.hasMany('foo'), | |
colors: DS.hasMany('color') | |
}); |
This file contains 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
[4mInitializing[24m | |
Command-line options: [36m--verbose[39m | |
Reading "Gruntfile.js" Gruntfile...[32mOK[39m | |
[1mRegistering Gruntfile tasks.[22m | |
[1mRegistering "grunt-contrib-copy" local Npm module tasks.[22m | |
Reading /Users/joseph.smith/Sites/testYo/node_modules/grunt-contrib-copy/package.json...[32mOK[39m | |
Parsing /Users/joseph.smith/Sites/testYo/node_modules/grunt-contrib-copy/package.json...[32mOK[39m |
This file contains 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.0.4 | |
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/munki | |
darwin { http_parser: '1.0', | |
node: '0.10.20', | |
v8: '3.14.5.9', | |
ares: '1.9.0-DEV', | |
uv: '0.10.17', | |
zlib: '1.2.3', | |
modules: '11', | |
openssl: '1.0.1e' } |
This file contains 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
// Generated on 2013-10-02 using generator-angular 0.4.0 | |
'use strict'; | |
var LIVERELOAD_PORT = 35729; | |
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }); | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: |
This file contains 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
if (typeof Math.factorial === "undefined") { | |
Math.factorial = function factorial (n) { | |
if (n == 0 || n == 1) | |
return 1; | |
if (Math.factorial.f[n] > 0) | |
return Math.factorial.f[n]; | |
else | |
return Math.factorial.f[n] = factorial(n-1) * n; | |
}; |
This file contains 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
(function(){ | |
var arr = [], | |
START_COUNT = 99; | |
TPL = '%count bottles of beer on the wall, %count bottles of beer, take 1 down, pass it around, %nextCount bottles of beer on the wall\r\n'; | |
function init () { | |
for (var i = START_COUNT; i > 0; i--) { | |
arr.push(hydrate({count: i, nextCount: i-1})); | |
} |
This file contains 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
/* lexical grammar */ | |
%lex | |
%% | |
\s+ /* skip whitespace */ | |
([0-9]) return 'DIGIT' | |
"am" return 'AM' | |
"pm" return 'PM' | |
":" return ':' | |
<<EOF>> return 'EOF' |