Install gparted and lilo
sudo apt-get -qy install gparted lilo
sudo liloconfig
git status --porcelain | grep -P '^\s?[MA]\s+.*.rb' | cut -c4- | xargs rubocop |
warning " > @rails/[email protected]" has unmet peer dependency "coffeescript@>= 1.12.7 || >= 2.x". | |
warning "@rails/webpacker > [email protected]" has unmet peer dependency "coffeescript@>= 1.8.x". | |
warning "@rails/webpacker > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697". | |
warning " > [email protected]" has unmet peer dependency "[email protected] - 3". | |
warning " > [email protected]" has unmet peer dependency "popper.js@^1.12.3". | |
warning " > [email protected]" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0". | |
warning " > [email protected]" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0". | |
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0". |
require 'matrix' | |
require 'set' | |
# Minesweeper board cell | |
class Cell | |
attr_accessor :bomb, :clicked, :flagged, :neighbor_bombs | |
def initialize(x, y, bomb = false, neighbor_bombs = 0) | |
@x = x |
// http://stackoverflow.com/a/5624139/6111717 | |
function hexToRgb(hex) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? { | |
r: parseInt(result[1], 16), | |
g: parseInt(result[2], 16), | |
b: parseInt(result[3], 16) | |
} : null; | |
} |
sudo curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |
from threading import Thread | |
from functools import wraps | |
def async(func): | |
""" | |
Wraps the func execution with a thread. | |
Usage: |
import redis | |
import time | |
def message_handler(message): | |
print(time.time() - float(message['data'])) | |
def run(): | |
r = redis.StrictRedis() |
/* Demonstrates the Goldbach's conjecture - Every even integer greater than 2 can be expressed as the sum of two primes | |
* | |
* author: Igor Hercowitz | |
* | |
* usage: java Goldbach <number> | |
* output: the sum of the primes list | |
* | |
* ex: | |
* > java Goldbach 100 | |
* 100 can be writen as: [97+3, 89+11, 83+17, 71+29, 59+41, 53+47] |
#!/bin/bash | |
ROOT=$1 | |
for dir in $(find $ROOT* -maxdepth 5 -type d | sort -z); do | |
echo "Deleting $dir" | |
cd $dir | |
perl -e 'for(<*>){((stat)[9]<(unlink))}' | |
cd .. | |
rm -r $dir |