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 a = "false"; | |
a = Boolean(a); | |
console.log(a); // -> true || WTF? |
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
### | |
Helps creating and submitting forms | |
- easy labeling | |
- automatically inserts values of the model to the form | |
- is able to serialize forms to JSON | |
- can submit the form to the server | |
- automatically displays errors if there are any | |
### | |
class FormHelper | |
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
// ddoc/byCollection/map.js | |
function(doc) { | |
if(doc.collection){ | |
emit(doc.collection, doc); | |
} | |
} |
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 net = require('net'); | |
var fs = require('fs'); | |
// file name for the current log | |
var fileName = __dirname + '/log_' + new Date().getTime(); | |
// Start a TCP Server | |
var server = net.createServer(function (socket) { | |
// Log what the TV sends |
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
myApp = angular.module 'myApp', [] | |
# encapsulates ajax stuff | |
myApp.factory 'myService', ($http, $rootScope) -> | |
data = { test: 123 } | |
url = 'http://192.168.2.4:8080/' | |
# doesn't do anything, no request in the server logs | |
postItNormal = -> | |
$http.post url, data |
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
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
ListView, | |
RecyclerViewBackedScrollView | |
} from 'react-native'; |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |