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
set SEGMENT_SEPARATOR '⮀'
set SEGMENT_BG
set RSTATUS
# Create segment of prompt
function prompt_segment
set -l bg $argv[1]
set -l fg $argv[2]
[ (count $argv) -gt 2 ]; and set -l content $argv[3..-1]
@hauleth
hauleth / rbenv.fish
Last active December 15, 2015 23:09
My fish function file for `rbenv` (require `rbenv-whatis` plugin for all features) :) Happy hacking.
function rbenv_shell
set -l vers $argv[1]
switch "$vers"
case '--complete'
echo '--unset'
echo 'system'
command rbenv versions --bare
return
case '--unset'
class Player < Competitor
belongs_to :team
attr_accessible :birth_date, :nationality
def age
now = Time.now.utc.to_date
now.year - birth_date.year - ((now.month > birth_date.month || (now.month == birth_date.month && now.day >= birth_date.day)) ? 0 : 1)
end
@hauleth
hauleth / 2d.c
Created December 10, 2012 11:35
Task with generating 2D array
int **a, i, j;
a = (int**)malloc(m*sizeof(int*));
for (i = 0; i < m; i++)
a[i] = (int*)malloc(n*sizeof(int);
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void menu()
{
cout << "\tKOLKO I KRZYZYK"<<endl;
cout << "Wcisnij:\n1. Wprowadz graczy\n2. GRA\nx. Koniec\n\n";
cout << "\tSTRUKTURA"<<endl;
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <algorithm>
using namespace std;
struct SProstokat {
unsigned int wysokosc, szerokosc;
};
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@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"
@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 / .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