Skip to content

Instantly share code, notes, and snippets.

View krzysztofjablonski's full-sized avatar

Krzysztof Jablonski krzysztofjablonski

  • Siepomaga.pl
  • Poznań
View GitHub Profile
@krzysztofjablonski
krzysztofjablonski / github_gpg_key.md
Last active February 14, 2020 21:38 — forked from ankurk91/github_gpg_key.md
Github : Signing commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Install required tools
  • Latest Git Client
  • gpg tools
brew install gpg
  • Generate a new gpg key
@krzysztofjablonski
krzysztofjablonski / gist:5700562
Last active December 18, 2015 00:59 — forked from kurisuchan/gist:1262135
Ramdisk for mysql
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev git-core
cd /tmp
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xvzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247/
./configure --prefix=/usr/local
make
make install
@krzysztofjablonski
krzysztofjablonski / gist:3904887
Created October 17, 2012 10:36
country2language
{
"AD" => ["Catalan"],
"AE" => ["Arabic"],
"AF" => ["Dari", "Pashto"],
"AG" => ["English"],
"AI" => ["English"],
"AL" => ["Albaniana"],
"AM" => ["Armenian"],
"AN" => ["Dutch", "Papiamento"],
"AR" => ["Spanish"],
@krzysztofjablonski
krzysztofjablonski / gist:3059230
Created July 6, 2012 09:38
Https locally with stunnel

Stunnel installation (OSX)

brew install stunnel

Certificate

openssl req -new -x509 -days 9999 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem
.vmm-timeline{}.vmm-timeline div *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
.vmm-timeline h1,.vmm-timeline h2,.vmm-timeline h3,.vmm-timeline h4,.vmm-timeline h5,.vmm-timeline h6,.vmm-timeline p,.vmm-timeline blockquote,.vmm-timeline pre,.vmm-timeline a,.vmm-timeline abbr,.vmm-timeline acronym,.vmm-timeline address,.vmm-timeline cite,.vmm-timeline code,.vmm-timeline del,.vmm-timeline dfn,.vmm-timeline em,.vmm-timeline img,.vmm-timeline q,.vmm-timeline s,.vmm-timeline samp,.vmm-timeline small,.vmm-timeline strike,.vmm-timeline strong,.vmm-timeline sub,.vmm-timeline sup,.vmm-timeline tt,.vmm-timeline var,.vmm-timeline dd,.vmm-timeline dl,.vmm-timeline dt,.vmm-timeline li,.vmm-timeline ol,.vmm-timeline ul,.vmm-timeline fieldset,.vmm-timeline form,.vmm-timeline label,.vmm-timeline legend,.vmm-timeline button,.vmm-timeline table,.vmm-timeline caption,.vmm-timeline tbody,.vmm-timeline tfoot,.vmm-timeline thead,.vmm-timeline tr,.vmm-timeline th,.vmm-timeline td,.vmm-timeline
* B-drzewo
- ilość rekordów * rozmiar rekordu
- 100 000 000 * 10B = 1 GB
* index bitmapa
- krotnosc * (ilość / 8) = x B
* tabela faktów
- dodajemy rozmiary wszystkich atrybutów
- mnozymy przez ilosc wszystkich rekordow w innych tabelach
@krzysztofjablonski
krzysztofjablonski / run.sh
Last active October 4, 2015 06:38
Chef runner
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev git-core
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0/
./configure --prefix=/usr/local
make
make install
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
#!/usr/bin/env ruby
def format_commit_info timestamp, time_desc, commit_id, message, ref_name
[
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}",
"(#{time_desc})",
commit_id,
message,
ref_name
]