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
Output:
std::cout bez sync_with_stdio(0)
real 0m0.084s
user 0m0.083s
sys 0m0.000s
std::cout z sync_with_stdio(0)
real 0m0.078s
@hauleth
hauleth / shell.rb
Created February 13, 2015 21:12
Simple shell
#!/usr/bin/env ruby
loop do
print '> '
exit 0 if gets.strip == 'exit'
puts 'USUŃ KONTO!'
end
class Listing < ActiveRecord::Base
if Rails.env.development?
has_attached_file :image, :styles => { :medium => "200x>", :thumb => "100x100>" }, :default_url => "404.png"
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
else
has_attached_file :image, :styles => { :medium => "200x>", :thumb => "100x100>" }, :default_url => "404.png",
:storage => :dropbox,
:dropbox_credentials => Rails.root.join("config/dropbox.yml"),
:path => ":style/:id_:filename"
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
@hauleth
hauleth / gist:39e74f1335c9eb04e129
Last active August 29, 2015 14:13
Filter application
fn clamp<N: PartialOrd>(val: N, min: N, max: N) -> N {
if val > max { max }
else if val < min { min }
else { val }
}
fn filter<P: Primitive + 'static, T: Pixel<P> + 'static, I: GenericImage<T>>(
image: &I,
kernel: &Matrix<f32>) -> ImageBuffer<Vec<P>, P, T> {
let xcenter = kernel.rows() / 2;
class Wektor
attr_accessor :coords
def initialize(length)
@coords = Array.new(length, 0)
end
def set!(w)
@coords = w.dup
#!ipxe
set base-url http://stable.release.core-os.net/amd64-usr/current
kernel ${base-url}/coreos_production_pxe.vmlinuz sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGZgyusYqIwWgs8vMK25noT6HiNh0Xsanm5oR2fFRJYKwt3P8zSxidGWH2FsgKDpGW+smrr0KChQ3ns9WC8RklM5Qbmxmjj0MwVToYE0npVri+ifEi4aAtAMj+gU6JOk5VUB/uTZzXWk17sNgCY6FXse/DP40lU21N0priRFzAx3uiSqj8/DyoLcqGA/2sV+1f3Iu+kts+kK4AGfo+SKkgu4PDYibM52jBHZnwXVOjqziZmf3I7XHdW+AhaktzPneU/sW2SdPTSwh4ZJLILWobIw7fu2cMlWz6Bn3pLsqnFJ3nSK9SCqPX33YGQDLm5c7gTnlcnkr67r9RdqFYD+Yn lukasz@niemier.pl"
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
boot
Verifying that +hauleth is my openname (Bitcoin username). https://onename.io/hauleth
(ns perun.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[cljs.core.async :refer [<!]]
[om-tools.core :refer-macros [defcomponent]]
[om-tools.dom :as dom :include-macros true]
[perun.elasticsearch :as es]))
(enable-console-print!)
Bundler 1.7.3
Ruby 2.1.2 (2014-05-08 patchlevel 95) [x86_64-linux]
Rubygems 2.4.2
GEM_HOME
Bundler settings
path
Set for your local app (/home/hauleth/Workspace/orodruin/.bundle/config): "vendor/bundle"
Set for the current user (/home/hauleth/.bundle/config): "vendor/bundle"
jobs
@hauleth
hauleth / .rubocop.yml
Last active January 27, 2016 10:22
Hauleth's template
AllCops:
Exclude:
- bin/*
- config/**/*
- coverage/**/*
- db/**/*
- doc/**/*
- log/**/*
- public/**/*
- script/**/*