Skip to content

Instantly share code, notes, and snippets.

#include <vector>
#include <iostream>
using namespace std;
// A utility function to add an edge in an
// undirected graph.
void addEdge(vector<int> adj[], int u, int v)
{
adj[u].push_back(v);
Verifying my Blockstack ID is secured with the address 1aHsQcBikpAcGimerzqa6oNP8aCBi9Fbd https://explorer.blockstack.org/address/1aHsQcBikpAcGimerzqa6oNP8aCBi9Fbd
@omelnyk
omelnyk / fswysiwyg-select.j
Last active May 25, 2016 15:33
fsymbols wysiwyg selection routines
u
@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 / nu-ska-vi-se.md
Created April 5, 2015 23:06
nu ska vi se

lala

  • 1
    • a
      • x
      • y
    • b
  • 2
@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 / 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 / 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 / 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 %}