Skip to content

Instantly share code, notes, and snippets.

⌨️
Click! Clack!

Łukasz Jan Niemier hauleth

⌨️
Click! Clack!
Block or report user

Report or block hauleth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hauleth
hauleth / shorten.c
Created Feb 27, 2011
My proposition to the shortest code for print sum of arithmetic progression from 1 to a
View shorten.c
main(a){while(scanf("%d",&a)>0)printf("%d",a*a+a>>1);}
View gist:984986
-- 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
View gist:985516
#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 Jun 1, 2011
Rozwiązanie zadań z matury 2011 z informatyki
View Matura.java
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 Dec 9, 2011
Rakeflie tasks for code quality testing
View Quality.rb
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
View index.html
<!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
Tango colours palette for SCSS.
View _palette.scss
$butter-light: #fce94f;
$butter: #edd400;
$butter-dark: #c4a000;
$orange-light: #fcaf3e;
$orange: #f57900;
$orange-dark: #ce5c00;
$chocolate-light: #e9b96e;
$chocolate: #c17d11;
View .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 Aug 23, 2012
Script for comparing I/O in stdlib and iostreams.
View test.sh
#!/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 Oct 19, 2012 — forked from matz/de.yml
#iOSonRailsConf 2013 web site translations
View de.yml
##############################
##############################
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"
You can’t perform that action at this time.