Skip to content

Instantly share code, notes, and snippets.

@skarab7
skarab7 / tmux.conf
Last active December 20, 2015 18:09
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Requirements (after https://gist.github.com/simme/1297707):
# Install http://www.culater.net/software/SIMBL/SIMBL.php
# Then install https://bitheap.org/mouseterm/
# Enable mouse support in ~/.tmux.conf
set-window-option -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
#
# Executes commands at the start of an interactive session.
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/aliases.zsh" ]]; then

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@skarab7
skarab7 / rst2pdf-with-dejavu-for-polish-docs
Last active August 29, 2015 14:12
rst2pdf-with-polish-letters
# The problem is: the default fonts that rst2pdf uses, do not cope very good with polish letters
# The solution: change the fonts with pdfstyle file to one that supports śćęą...
# 1. Create pdfstyle file
# (after https://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/styles/dejavu.json):
cat > ./dejavu.pdfstyle <<DELIM
{
"fontsAlias" : {
"stdFont": "DejaVu Sans",
@skarab7
skarab7 / ubuntu_customization_notes
Last active August 29, 2015 14:14
ubuntu_customization_notes
What to install:
- apt-get install unity-tweak-tool
- apt-get urxvt # TODO: read how to configure
- irssi # TODO: configure
- mutt+gpg+... # TODO: configure
@skarab7
skarab7 / infinitest_with_gradle
Last active August 29, 2015 14:15
simple_infinitest_with_gradle
# we use tail to cut off gradle lifecycle info
# we use grep to get all the content before :test FAILED that contains error info
while :; do gradle test | tail -n +7 | grep -B 100 ':test FAILED' ; sleep 1; done
@skarab7
skarab7 / nova_create_instance
Last active August 29, 2015 14:27
How to use Openstack CLI modules in your scripts
instance = nv.servers.create(name=instance_name,
image=img, flavor=flavor,
security_groups=[sec_group_name],
key_name=ssh_key_name,
userdata=cloud_init)
# availability_zone="internal:" + service_host)
status = instance.status
while status == 'BUILD':
time.sleep(3)
instance = nv.servers.get(instance.id)
@skarab7
skarab7 / Vagrantfile
Created September 30, 2015 00:26
Devstack with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
@skarab7
skarab7 / one_liner_bcrypt.py
Last active October 5, 2015 23:58
one_liner_bcrypt.py
python -c "import bcrypt; print bcrypt.hashpw('password', bcrypt.gensalt());"
def porownaj_implementacje_sortowania(n)
a = []
generuj_tablice_N_elementow(a, n)
czas_babelkowego = get_czas_sortowania_babelkowego(a)
czas_quicksort = get_czas_sortowania_quicksort(a)
puts "Numer elementów #{n}, bubble: #{czas_babelkowego}, qs: #{czas_quicksort}"
end
def generuj_tablice_N_elementow(tablica, ilosc_elementow)
(1..ilosc_elementow).each do |i|