Skip to content

Instantly share code, notes, and snippets.

View Janiczek's full-sized avatar

Martin Janiczek Janiczek

View GitHub Profile
USE `d73213_ethics`;
DROP TABLE IF EXISTS `prispel`;
CREATE TABLE `prispel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`prispel` int(11) NOT NULL,
`last_updated` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
@Janiczek
Janiczek / .vimrc
Created February 20, 2015 14:02
.vimrc for Solarized Rainbow Parentheses
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['darkgreen', 'firebrick3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
sudo vi /etc/default/grub
...
sudo update-grub
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
@Janiczek
Janiczek / ProjectEuler.coffee
Created May 31, 2011 21:57
First few Project Euler problems solved in CoffeeScript. Comments on how to make it more beautiful (in terms of CoffeeScript, not algorithm) highly appreciated!
@_1 = ->
# sum of multiples of 3 or 5 (not both) under 1K
answer = 0
for n in [1...1000]
if n % 3 == 0 or n % 5 == 0
answer += n
@Janiczek
Janiczek / mm_algos.py
Created August 5, 2011 20:19
Memory Management algorithms
# =======================================================================
# =======================================================================
# =======================================================================
# =============================================================== Info ==
# This is also known as Bin Packing Problem
# http://en.wikipedia.org/wiki/Bin_packing_problem
# inspiration: http://www.developerfusion.com/article/5540/bin-packing/
# or maybe Knapsack Problem?
@Janiczek
Janiczek / genetics.coffee
Created April 12, 2012 13:43
Evoluční algoritmus
#======================================================================#
# Biologicke algoritmy (2) - Evoluční algoritmy #
# http://www.root.cz/clanky/biologicke-algoritmy-2-evolucni-algoritmy/ #
#======================================================================#
#
# hledame kruznice, ktere nejvic sedi na danou mnozinu bodu
#
# ----------------------------------------------------------
#
# jedinec = trojice kruznic
@Janiczek
Janiczek / Makefile
Created July 17, 2012 23:59
Binary search in Erlang
run:
erlc binary_search.erl
erl -noshell -s binary_search test -s init stop
tests:
python write_tests.py >binary_search_tests.erl
erlc binary_search_tests.erl
all: tests run
@Janiczek
Janiczek / yt.py
Created July 23, 2012 19:38
YouTube downloader
#! /usr/bin/env python
# dependencies: py-gdata
# example usage:
# ./yt.py "words that have to be in title"
import sys
import gdata
import gdata.youtube
@Janiczek
Janiczek / gulpfile.js
Created November 29, 2015 23:07
auto reloading gulpfile
var gulp = require('gulp');
var elm = require('gulp-elm');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var livereload = require('gulp-livereload');
var path = ['src/**/*.elm','tests/**/*.elm'];
gulp.task('elm-init', elm.init);
@Janiczek
Janiczek / primes.erl
Last active December 10, 2015 21:38
Imitation of http://numbersimulation.com/ using different languages and techniques, currently Go and Erlang.
-module(go).
-export([prime/3,
server/0,
server/4,
start/0]).
prime(OldTick, N, Server) ->
receive
false -> ok
end,