# Remove all stopped containers
docker rm $(docker ps -a -q)
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 db | |
from multiprocessing import Pool | |
def process_pollution(wb): | |
pass | |
if __name__ == '__main__': | |
items = db.waterbodies.find() | |
p = Pool(16) | |
p.map(process_pollution, items) |
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
package main | |
import ( | |
"fmt" | |
"strings" | |
"sync" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
) |
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
cat access.log | awk '{ print $1 }' | sort | uniq -c | sort -n |
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 fs = require('fs'); | |
var c = {}; | |
fs.readFile('ips', function(err, data) { | |
var ips = data.toString().split('\n'); | |
for (var i in ips) { | |
if (!c[ips[i]]) { | |
c[ips[i]] = 1 |
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 cats = require('services/cats'); | |
var dogs = require('services/dogs'); | |
var doStuff = function(data) { | |
whether(data.doge).then(function() { | |
return dogs.create(data).then(function(doge) { | |
data.doge_id = doge.id; | |
}); | |
}).then(function() { | |
return cats.create(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
var titles = ['день', 'дня', 'дней']; | |
var right_word = function (number) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number %10 < 5) ? number % 10 : 5]]; | |
} |
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 test = test(); | |
var login = function(credentials) { | |
return test() | |
.post('/login', credentials); | |
}; | |
var createAffiliate = test() | |
.post('/affiliates', casual.affiliate) | |
.as('affiliate') |
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'; | |
angular.module('fitApp', ['ngRoute']). | |
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { | |
$routeProvider. | |
when('/', { | |
templateUrl: 'partials/index.html', | |
controller: IndexCtrl | |
}). | |
when('/exercises', { |
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
## Generators ideas | |
- category | |
- dollar | |
- gender | |
- age | |
- array_of stuff | |
## db util | |
## gossip server (monitoring) |