This file contains hidden or 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
% apt-get install texlive-portuguese | |
\usepackage[brazilian]{babel} |
This file contains hidden or 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
/* | |
* This is the Towers of Hanoi example from the prolog tutorial [1] | |
* converted into Scala, using implicits to unfold the algorithm at | |
* compile-time. | |
* | |
* [1] http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_3.html | |
*/ | |
object TowersOfHanoi { | |
import scala.reflect.Manifest |
This file contains hidden or 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 net.abhinavsarkar.util; | |
import java.util.Iterator; | |
import java.util.concurrent.BrokenBarrierException; | |
import java.util.concurrent.CyclicBarrier; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.SynchronousQueue; | |
import java.util.concurrent.ThreadFactory; | |
import java.util.concurrent.TimeUnit; |
This file contains hidden or 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
sudo grub | |
root (hd0,1) | |
setup (hd0) | |
quit |
This file contains hidden or 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
require 'csv' | |
CSV.foreach('path/to/seed.csv', headers: true, col_sep: ';') do |row| | |
Model.create row.to_hash | |
end |
This file contains hidden or 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
big_O.plot <- function(count,log="") { | |
n <- seq(count) | |
plot(n, n*n, log=log, type='l', col='red', | |
ylab="Running time", xlab='n (# of elements)') | |
lines(n, n*log(n), col='green') | |
lines(n, n, col='blue') | |
lines(n, log(n), col='black') | |
title('Running time of common time complexities') |
This file contains hidden or 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
usage(){ | |
echo "Usage: $(basename $0) [-c <cols>] [-r <rows>] [-p <pch>]" | |
exit 2 | |
} | |
cols=50 | |
rows=20 | |
pch="*" | |
while getopts "c:r:p:h" option; do | |
case "$option" in |
This file contains hidden or 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
# | |
# File: /etc/logrotate.d/rails | |
# Test: logrotate -f /etc/logrotate.d/rails | |
# | |
/var/www/*/log/*.log { | |
daily | |
dateext | |
notifempty | |
missingok | |
rotate 30 |
This file contains hidden or 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
SELECT * INTO OUTFILE 'result.csv' | |
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' | |
FROM my_table; |
This file contains hidden or 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
#!/bin/sh | |
# Usage: | |
# - Save this file in /etc/cron.daily/gitlab | |
# - Enable execution permission: chmod +x /etc/cron.daily/gitlab | |
set -e | |
DB_USERNAME=username | |
DB_PASSWORD=secret | |
BACKUP_DIR='/path/to/backup/' |
OlderNewer