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
<input type='file' onchange="angular.element(this).scope().setImage(this)" /> |
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('analytics', []) | |
.service('analytics', function($rootScope, $window, $location) { | |
var track = function() { | |
$window._gaq.push(['_trackPageview', $location.path()]); | |
}; | |
$rootScope.$on('$viewContentLoaded', track); | |
} | |
); |
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
for key in `redis-cli "KEYS" "app:scope:*" | awk '{print $1}'` | |
do redis-cli "DEL" "$key" | |
done |
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 express = require("express"); | |
var app = express(); | |
app.configure(function() { | |
app.use(express.static(__dirname + './boxes')); | |
app.use(express.errorHandler()); | |
}); | |
var port = 8080; | |
app.listen(port); |
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
-Xmn256m -Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=512m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods |
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
echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list | |
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
sudo apt-key add rabbitmq-signing-key-public.asc | |
apt-get update | |
apt-get install rabbitmq-server -y | |
service rabbitmq-server start | |
rabbitmq-plugins enable rabbitmq_management | |
rabbitmqctl add_user admin password | |
rabbitmqctl set_user_tags admin administrator | |
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" |
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 winston = require('winston'); | |
var logger = new (winston.Logger)({ | |
transports: [ | |
new (winston.transports.Console)({ json: false, timestamp: true }), | |
new winston.transports.File({ filename: __dirname + '/debug.log', json: false }) | |
], | |
exceptionHandlers: [ | |
new (winston.transports.Console)({ json: false, timestamp: true }), | |
new winston.transports.File({ filename: __dirname + '/exceptions.log', json: false }) |
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
aria2c -x10 -j1 -ilinks |
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 request = require('request'); | |
var xml2js = require('xml2js'); | |
/* | |
código do serviço. | |
40010 SEDEX | |
41106 PAC |
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
// <input number-format type="text" ng-model="value" /> | |
angular.module('module', []) | |
.directive('numberFormat', function($filter) { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, ngModel) { | |
var prepare = function(value) { | |
var numb = Number(value); |
OlderNewer