Skip to content

Instantly share code, notes, and snippets.

@quieterkali
quieterkali / 0 - data.md
Created November 28, 2018 16:28 — forked from sundarj/0 - data.md
data: towards enlightenment

data

towards enlightenment

‘It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.’

@quieterkali
quieterkali / docker error
Last active January 6, 2018 02:01
error do nodemon
sudo docker run -p 8080:3000 -v $(pwd):/home/security/Documents/projects/docker-source-monitor -w "/home/security/Documents/projects/docker-source-monitor" node npm start
> [email protected] start /home/security/Documents/projects/docker-source-monitor
> npm run watch
> [email protected] watch /home/security/Documents/projects/docker-source-monitor
> nodemon --watch ./src -e ts,ejs --exec "npm run compile && npm run views && npm run build"
sh: 1: nodemon: not found
@quieterkali
quieterkali / curry
Created August 6, 2017 01:44
custom curry funtion
const curry = (fn) => {
if(typeof fn !== 'function') {
throw Error('No function provided');
}
return function curriedFn(...args) {
if(args.length < fn.length) {
return function() {
return curriedFn.apply(null, args.concat([].slice.call(arguments)));
};
@quieterkali
quieterkali / augmenting
Created July 28, 2017 08:41
reading the good part
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
};
$ = jquery = require('jquery');
((win) => {
'use strict';
var React = require('react');
var ReactDom = require('react-dom');
var Home = require('./component/homePage');
module.exports = CodeMachine = function (coffee) {
if (coffee instanceof Coffee) {
throw new TypeError('CodeMachine needs coffee to work')
}
var linesOfCode = []
for (var i = 0, end = Math.random() * 1000; i < end; i++) {
var line = []
@quieterkali
quieterkali / 0.md
Created October 12, 2016 13:23 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

controllers.controller('ListaImoveisCtrl', function($rootScope, $scope, $ionicPlatform, $location, $timeout, $ionicLoading, $cordovaSQLite, $stateParams, imoveisService) {
$scope.$on('$ionicView.enter', function () {
imoveisService.getImoveis(imoveisService.formData).success(function (imoveis) {
if (!imoveis || !imoveis.length) {
throw new Error('Algo deu errado ao tentar carregar informações de imóveis.');
}
$scope.imoveis = imoveis
if ($stateParams.idAtendimento == undefined) {