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
module.exports = function (err, result, cb, resolve, reject) { | |
if (cb) { | |
if (err) { | |
reject(err); | |
} | |
else { | |
resolve(result); | |
} | |
return cb(err, result); |
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
Show hidden characters
{ | |
"requireSemicolons": true, | |
"validateQuoteMarks": "'", | |
"requirePaddingNewLinesAfterUseStrict": true, | |
"dissallowTrailingComma": true, | |
"disallowSpacesinFunction": true, | |
"maximumLineLength": 120, | |
"requireCamelCaseOrUpperCaseIdentifiers": true, | |
"disallowMixedSpacesAndTabs": "smart", | |
"disallowEmptyBlocks": true, |
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
angular.module('mtLigaFantastica') | |
.controller('LineupViewController', LineupViewController); | |
function LineupViewController(Restangular, $state, $modal, $window, $log, $interval, $rootScope, $http, $timeout, $localStorage) { | |
'use strict'; | |
var vm = this; | |
var _ = $window._; //underscore | |
var localStorage = $window.localStorage; //localstorage -> hará falta usar ngStorage? | |
var latency = 2000; // después de este tiempo, se bloquea la interfaz en caso de que no responda el API | |
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
Dividing x by Math.pow(10, n) shifts x by n digits to the right: 123123123 / 10^10 = 0.0123123123, | |
that way you can turn any number between 0 and 10^n-1 into a value between 0 and 1. | |
Subtracting it from 1 reverses the order, so that older is smaller (so results in a better rank value) |
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
'use strict'; | |
var express = require('express'); | |
var app = new express(); | |
var compression = require('compression'); | |
var bodyParser = require('body-parser'); | |
var cookieParser = require('cookie-parser'); | |
var errorHandler = require('error-handler'); | |
var session = require('express-session'); |
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/env bash | |
sudo apt-get update | |
sudo apt-get install -y software-properties-common curl | |
sudo apt-add-repository ppa:nginx/stable -y | |
sudo apt-add-repository ppa:rwky/redis -y | |
sudo apt-add-repository ppa:chris-lea/node.js -y | |
sudo apt-add-repository ppa:ondrej/php5-5.6 -y |
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
Port 2222 | |
ListenAddress 127.0.0.1 | |
Protocol 2 | |
HostKey /etc/ssh/ssh_host_rsa_key | |
HostKey /etc/ssh/ssh_host_dsa_key | |
HostKey /etc/ssh/ssh_host_ecdsa_key | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
UserPrivilegeSeparation yes | |
KeyRegenerationInterval 3600 | |
ServerKeyBits 1024 |
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
npm WARN package.json [email protected] No repository field. | |
npm WARN package.json [email protected] No README data | |
| | |
> [email protected] install /home/diegoaguilar/factory.js/node_modules/i2c | |
> node-gyp rebuild | |
make: Entering directory `/home/diegoaguilar/factory.js/node_modules/i2c/build' | |
CXX(target) Release/obj.target/i2c/src/i2c.o | |
../src/i2c.cc: In function ‘void setAddress(int8_t)’: | |
../src/i2c.cc:22:14: error: ‘class v8::Isolate’ has no member named ‘ThrowException’ |
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
from cv2 import * | |
import sys | |
bottle_image_name = sys.argv[1] | |
bottle_image_gray = imread(bottle_image_name,CV_LOAD_IMAGE_GRAYSCALE) | |
(tresh, im_bw) = threshold(bottle_image_gray, 127, 255, THRESH_BINARY) | |
imwrite('bw.png',im_bw) | |
bottle_image_bw = imread('bw.png',CV_LOAD_IMAGE_UNCHANGED) | |
contours, hierarchy = findContours(bottle_image_bw, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE) |
NewerOlder