Skip to content

Instantly share code, notes, and snippets.

@acirtautas
acirtautas / basketball_game_example_input.txt
Created May 19, 2014 18:18
Basketball game @ Facebook hacker cup 2014 qualification round
5
6 3 2
Wai 99 131
Weiyan 81 155
Lin 80 100
Purav 86 198
Slawek 80 192
Meihong 44 109
7 93 2
Paul 82 189
@acirtautas
acirtautas / .bashrc
Created May 20, 2014 07:10
Git linux configuration
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
@acirtautas
acirtautas / PrimeNumberDecomposition.php
Created July 15, 2014 13:28
Prime number decomposition
<?php
class PrimeNumberDecomposition
{
public static function Generate($number)
{
if (self::isPrime($number)) {
return [$number];
}
@acirtautas
acirtautas / augino_mociute.rb
Created March 29, 2015 10:49
Sonic PI melodies
# Augino mociute
use_bpm 34
use_synth :pretty_bell
astuntine = 0.125 #Eight note
ketvirtine = 0.25 #Quarter note
pusine = 0.5 #Half note
pilna = 1 #Whole note
@acirtautas
acirtautas / Vagrantfile
Last active January 27, 2016 22:42
Vagrant quick start with PHP
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/www/html", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
config.vm.provision "shell", inline: <<-SHELL
@acirtautas
acirtautas / keys.py
Created August 7, 2015 14:03
Python script to read 1-4 key presses and log it to the file, q to quit
import termios, tty, sys, time
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
tty.setcbreak(sys.stdin)
try:
print('Waiting for key pressed [1,2,3,4] or [q] to quit')
while True: