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
<Song tempo={90}> | |
<Sequencer resolution={16} bars={1}> | |
<Reverb> | |
<Delay> | |
<Monosynth | |
steps={[ | |
[0, 4, "c3"], | |
[4, 4, "c4"], | |
]} | |
/> |
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
<Router history={browserHistory}> | |
<Route path=”/” component={App}> | |
<Route path=”users” component={Users}> | |
<Route path=”/user/:userId” component={User}/> | |
</Route> | |
<Route path=”*” component={NoMatch}/> | |
</Route> | |
</Router> |
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
const routes = [ | |
{ path: '/', component: App }, | |
{ path: '/users/', component: UserList }, | |
{ path: '/users/:userId', component: User }, | |
{ path: '*', component: Default }, | |
]; | |
<Router history={browserHistory} routes={routes} /> |
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
// Helper to record CPU profiles | |
// https://github.com/node-inspector/v8-profiler#cpu-profile-api | |
// | |
// Usage: | |
// 1. npm install v8-profiler | |
// 2. require('./cpu-profile-trigger') once in your app code | |
// 3. Start CPU profiling with kill -PIPE <pid>. Instructions will be logged to stdout. | |
// 4. Stop CPU profiling with running again kill -PIPE <pid> | |
// 5. Go to Chrome debugger, open Profiles tab. Click Load and | |
// open the <timestamp>.cpuprofile. It was saved to the same dir |
(My opinionated view as an Express developer)
Check this post: http://matt-harrison.com/moving-from-express-to-hapi-js/ and how to use Hapi plugins: https://gist.github.com/hueniverse/f01faf422eb038d87d57 written by Hapi creator Eran Hammer.
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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import random | |
from math import floor | |
kirjaimet = {u' ': u'00', u'!': u'01', u'"': u'02', u'#': u'03', u'$': u'04', u'%': u'05', u'&': u'06', u'\'': u'07', u'(': u'08', u')': u'09', u'*': u'10', u'+': u'11', u',': u'12', u'-': u'13', u'.': u'14', u'/': u'15', u'0': u'16', u'1': u'17', u'2': u'18', u'3': u'19', u'4': u'20', u'5': u'21', u'6': u'22', u'7': u'23', u'8': u'24', u'9': u'25', u':': u'26', u';': u'27', u'<': u'28', u'=': u'29', u'>': u'30', u'?': u'31', u'@': u'32', u'A': u'33', u'B': u'34', u'C': u'35', u'D': u'36', u'E': u'37', u'F': u'38', u'G': u'39', u'H': u'40', u'I': u'41', u'J': u'42', u'K': u'43', u'L': u'44', u'M': u'45', u'N': u'46', u'O': u'47', u'P': u'48', u'Q': u'49', u'R': u'50', u'S': u'51', u'T': u'52', u'U': u'53', u'V': u'54', u'W': u'55', u'X': u'56', u'Y': u'57', u'Z': u'58', u'[': u'59', u'\\': u'60', u']': u'61', u'^': u'62', u'_': u'63', u'`': u'64', u'a': u'65', u'b': u'66', u'c': u'67', u'd': u'68', u'e': u'69', u'f': u'70', u'g': |
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
print "Matikka ohjelma" | |
print "-----------------------" | |
print "Valitse vaihtoehto:" | |
print "1 Simppelit laskut" | |
print "2 Pinta-alat ja tilavuudet" | |
print "3 Muita laskuja" | |
ehto = input("> ") |
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
console.warn('- console.(debug|info|log|warn|error) monkey-patched'); | |
const methods = ['debug', 'info', 'log', 'warn', 'error']; | |
// We have to take the direct references to the actual function like this | |
// instead of doing just: originalConsole = console | |
const originalConsole = _.reduce(methods, (memo, methodName) => { | |
memo[methodName] = _.bind(console[methodName], console); | |
return memo; | |
}, {}); |
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* uniqueId() { | |
var i = 0; | |
while (true) { | |
yield i; | |
++i; | |
} | |
} | |
var idGenerator = uniqueId(); |