Skip to content

Instantly share code, notes, and snippets.

View mtimkovich's full-sized avatar
🐢

Max Timkovich mtimkovich

🐢
View GitHub Profile
@mtimkovich
mtimkovich / chess960.py
Last active May 31, 2024 20:07
Chess960 Initial Position Generator (Python)
#!/usr/bin/env python
import random
def empty(lst):
return [i for i, value in enumerate(lst) if value == 0]
board = [0] * 8
# Bishops
for i in range(2):
@mtimkovich
mtimkovich / ci-new.sh
Created June 6, 2012 03:11
CodeIgniter New Project Generator
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 [app]"
exit
fi
cache_dir="$XDG_CONFIG_HOME/codeigniter"
if [ ! -d $cache_dir ]; then
@mtimkovich
mtimkovich / chess960.rb
Created October 29, 2011 00:58
Chess960 Initial Position Generator (Ruby)
#!/usr/bin/ruby
board = Array.new(8)
# Bishops
2.times do |i|
r = rand(4) * 2
if i == 1
r += 1
@mtimkovich
mtimkovich / absorb.sh
Created May 9, 2011 01:57
A simple Bash script I wrote to automate copying PKGBUILD scripts and makepkg in Arch Linux
#!/bin/bash
yesno()
{
echo -ne "$1 [Y/n] "
read -r
case $REPLY in
[yY]) return 0 ;;
*) return 1 ;;
esac