Skip to content

Instantly share code, notes, and snippets.

@omelnyk
omelnyk / ubuntu-get-rocking.sh
Last active December 4, 2016 02:23
ubuntu-get-rocking.sh
#!/bin/bash
#
# Copyleft (c) 2013 Olexandr Melnyk <me@omelnyk.net>. Use at your own risk.
# Last revision: 2014-01-31 07:33:15 UTC
#
# software repos
sudo dpkg --add-architecture i386
@omelnyk
omelnyk / ubuntu-amd64-skype-webcam-mely-fix.sh
Last active December 25, 2015 07:59
ubuntu-amd64-skype-webcam-mely-fix.sh
#!/bin/bash
sudo apt-get install lib32v4l-0
sudo tee /usr/local/bin/skype > /dev/null << EOL
#!/bin/bash
LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so /usr/bin/skype
EOL
@omelnyk
omelnyk / TwigExample.md
Created December 15, 2013 16:21
JMSTranslationBundle + Twig

Standard way (with or without JMSTranslationBundle):

1a. Inline syntax without description (can be done):

{{ "navigation.menu.hello" | trans({'%name%':'Tester'}) }}

1b. Block syntax without description (can be done):

{% trans with {'%name%': 'Tester'} %}navigation.menu.hello{% endtrans %}
@omelnyk
omelnyk / grub.cfg.ssd.diff
Created January 10, 2014 14:17
grub.cfg.ssd.diff
--- grub.cfg.orig 2014-01-09 15:32:35.434458513 +0000
+++ grub.cfg.ssd 2014-01-09 15:38:44.752289861 +0000
@@ -60,7 +60,7 @@
insmod part_msdos
insmod lvm
insmod ext2
-set root='lvm/ubuntu--vg-root'
+set root='(hd0,1)'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvm/ubuntu--vg-root' 988304c3-2da0-455d-8a97-124956557e37
.
@omelnyk
omelnyk / subshuffle.rb
Last active August 29, 2015 13:56
SubShuffle: shuffle lines from SubRip subtitles for language learning
#!/usr/bin/ruby
abort "Usage: ./subshuffle.rb <srt-file>" if ARGV.count != 1
subs = []
text = ""
open(ARGV.last) do |file|
file.each do |line|
line.strip!
@omelnyk
omelnyk / alfabet-ordlist.md
Last active August 29, 2015 14:18
Alfabet orlista (svenska)

Djur

A alligator

B bison, bi,

C

D

@omelnyk
omelnyk / nu-ska-vi-se.md
Created April 5, 2015 23:06
nu ska vi se

lala

  • 1
    • a
      • x
      • y
    • b
  • 2
@omelnyk
omelnyk / wheel-of-fortune.rb
Created January 11, 2016 14:53
Wheel of fortune
#!/usr/bin/ruby
words = ["apple", "car", "bus", "tools"]
word = words.sample
puzzle = "_" * word.length
ERROR_THRESHOLD = 7
error_count = 0
puts "Puzzle: #{puzzle}"
while puzzle != word and error_count < ERROR_THRESHOLD do
@omelnyk
omelnyk / fswysiwyg-select.j
Last active May 25, 2016 15:33
fsymbols wysiwyg selection routines
u