Skip to content

Instantly share code, notes, and snippets.

14:52:58.938 [info] HTTP port: 4001
14:52:58.938 [info] Permissions file path: permissions.yml
14:52:58.938 [info] Passwd file path: passwd.yml
14:52:58.938 [info] Consumer groups cache directory: priv
14:52:58.948 [info] Kafka cluster: [{'localhost', 9092}]
14:52:58.948 [info] brod producer config: []
14:52:58.950 [info] brod ssl config: false
14:52:58.950 [info] not using sasl auth
14:52:58.953 [info] Zookeeper cluster: [{'localhost', 2181}]
14:52:58.953 [info] Reloading permissions from permissions.yml
@andrusha
andrusha / fez_decypher.rb
Created May 24, 2014 10:19
Fez game language decypherer
$alphabet =
{
11 => ?i,
12 => ?c,
13 => ?u,
14 => ?o,
21 => ?t,
22 => ?n,
23 => ?h,
@andrusha
andrusha / iso_to_usb.sh
Last active October 9, 2016 22:34
Create bootable USB from ISO image on Mac
hdiutil convert -format UDRW -o destination_file.img source_file.iso
# Or re-partition it with Disk Utility with 1 Free Space Partition
diskutil partitionDisk /dev/disk2 1 "Free Space" "unused" "100%"
# Or copy the image through Disk Utility in Restore menu
dd if=destination_file.img.dmg of=/dev/disk2 bs=1m
# Or eject manually
diskutil eject /dev/disk2
@andrusha
andrusha / config.txt
Created August 23, 2013 14:32
Raspberry PI config for PAL RC output with overscan
avoid_safe_mode=1
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
@andrusha
andrusha / gist:4625608
Created January 24, 2013 17:42
God supervisor example config for node.js app
#!/usr/bin/env ruby
God.watch do |w|
w.group = "hubot_group"
w.name = "hubot"
w.interval = 1.seconds
w.env = { 'NODE_ENV' => 'production'}
w.start = "node ..."
w.start_grace = 5.seconds
w.restart_grace = 5.seconds
@andrusha
andrusha / vk_audio_remove
Last active August 22, 2023 13:16
Remove all audio files from vkontakte profile (javascript console snippet). Удалить все аудиозаписи из профиля вконтакте.
var nodes = document.querySelectorAll(".audio_remove"), i = 0, inter = setInterval( function() { if (i == nodes.length) { clearInterval(inter);}; var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, nodes[i], 0, 0, 0, 0, 0, false, false, false, false, 0, null); nodes[i].dispatchEvent(evt); i++; }, 350);
@andrusha
andrusha / test_file.rb
Created December 16, 2012 10:54
A support library to abstract usage of files in tests
# As a separate module, because we might want to
# mock some files in the future or use generator
# for the same reason it returns opened instance of file
#
# Each method check if corresponding file exists in
# spec/support/files/file.name.kitten.ext
# if method has `_path` in the end Pathname instance would be returned
# otherwise it will be File instance
module TestFiles
def self.respond_to?(method)
@andrusha
andrusha / gist:3969506
Created October 28, 2012 19:10
Word document readers benchmark results
❯ /usr/bin/time -l antiword ~/Projects/universiteam/spec/support/files/lorem.complex.doc
0.02 real 0.00 user 0.00 sys
688128 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
157 page reclaims
32 page faults
0 swaps
7 block input operations
@andrusha
andrusha / gist:2713435
Created May 16, 2012 19:53
Lambda-calculus beta-reduction algorithm
import Data.Traversable
data Term a =
Var a
| Lambda a (Term a)
| Apply (Term a) (Term a)
instance Show a => Show (Term a) where
show (Var v) = show v
show (Lambda n t) = "/" ++ (show n) ++ "." ++ (show t)
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
Or like:
{% if condition %} print {%=object.something %}{% endif %}
This, of course, completely screws up Django templates,