Skip to content

Instantly share code, notes, and snippets.

View hauleth's full-sized avatar
⌨️
Click! Clack!

Łukasz Jan Niemier hauleth

⌨️
Click! Clack!
View GitHub Profile
@hauleth
hauleth / shorten.c
Created February 27, 2011 18:34
My proposition to the shortest code for print sum of arithmetic progression from 1 to a
main(a){while(scanf("%d",&a)>0)printf("%d",a*a+a>>1);}
-- Copyright (c) 2011 by Łukasz Niemier <lukasz@niemier.pl>
import System( getArgs )
fibonacci = 0 : 1 : (zipWith (+) fibonacci $ tail fibonacci)
printFib x = if x < 0 then error "Index must be greater or equal 0" else print $ fibonacci !! x
main = do
args <- getArgs
#include <list>
#include <iostream>
class Base {
public:
typedef void (*func_each)(Base*);
private:
typedef std::list<Base*> instances_list;
static instances_list _SM_instances;
public:
@hauleth
hauleth / Matura.java
Created June 1, 2011 11:20
Rozwiązanie zadań z matury 2011 z informatyki
public class Matura {
private static int sklej(int i) {
if(i < 2)
return 1;
else
return i - 1 + (i % 2 == 1 ? sklej(i/2) + sklej((i+1)/2) : 2*sklej(i/2));
}
private static int[] sklej_gen(int size) {
int[] tab = new int[size];
tab[0] = tab[1] = 1;
@hauleth
hauleth / Quality.rb
Created December 9, 2011 16:37
Rakeflie tasks for code quality testing
require 'flog_task'
require 'flay_task'
desc "Runs all code quality metrics"
task :quality => [:'quality:flog', :'quality:flay']
namespace :quality do
FlogTask.new :flog, 200, %w[app lib]
FlayTask.new :flay, 200, %w[app lib]
end
<!DOCTYPE html>
<html>
<head>
<title>Ruby on Rails: Welcome aboard</title>
<style type="text/css" media="screen">
body {
margin: 0;
margin-bottom: 25px;
padding: 0;
background-color: #f0f0f0;
@hauleth
hauleth / _palette.scss
Created May 12, 2012 15:47
Tango colours palette for SCSS.
$butter-light: #fce94f;
$butter: #edd400;
$butter-dark: #c4a000;
$orange-light: #fcaf3e;
$orange: #f57900;
$orange-dark: #ce5c00;
$chocolate-light: #e9b96e;
$chocolate: #c17d11;
@hauleth
hauleth / .vimrc
Created July 4, 2012 18:39
My .vimrc
" Infect Vim with pathogen
call pathogen#infect()
" Use ZSH as Vim shell to get rid of strange errors
set shell=/bin/zsh
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
@hauleth
hauleth / test.sh
Created August 23, 2012 17:38
Script for comparing I/O in stdlib and iostreams.
#!/bin/sh
times=1000000 # count
main="int main(){"
loop=" for(int i = 0; i < $times; i++) "
end=" return 0;}"
CXX=g++
FLAGS=-O2
file=test.cpp # outfile
@hauleth
hauleth / de.yml
Created October 19, 2012 17:43 — forked from matz/de.yml
#iOSonRailsConf 2013 web site translations
##############################
##############################
robot_in_the_cloak: "Roboter im Regenmantel"
site_title: "#iOSonRailsConf 2013"
site_description: "Alushta Konferenz für Ruby on Rails und iOS-Entwickler aus aller Welt, die im Frühjahr 2013 stattfinden wird."
site_description_short: "Ruby on Rails und iOS-Entwickler Alushta Konferenz 2013."
site_keywords: "Ruby, Rails, ios, Entwickler, Konferenz, 2013, Web, Handy, iphone, ipad, ipod"