Skip to content

Instantly share code, notes, and snippets.

@Ficik
Ficik / gist:4957636
Last active December 13, 2015 18:48
ficik@ficik-desktop:~$ DEBUGGER=gdb steam
Running Steam on ubuntu 12.10 32-bit
STEAM_RUNTIME is disabled by the user
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
@Ficik
Ficik / gist:5170629
Last active December 15, 2015 00:09
Asyn delete homework
http = require "http"
DB =
pending : []
customer : [
"This is existing entity"
"This is existing entity"
"This is existing entity"
"This is existing entity"
"This is existing entity"
@Ficik
Ficik / gist:5182937
Created March 17, 2013 18:27
w20-2-stateless
net = require 'net'
DB = {}
server = net.createServer (con) ->
con.setEncoding 'utf8'
process = (action, token, value) ->
return "Commands: open, add, process" unless action in ["open", "add", "process"]
return "order token not specified" unless token
@Ficik
Ficik / gist:5182942
Created March 17, 2013 18:29
w20-2-statefull
net = require 'net'
server = net.createServer (con) ->
con.setEncoding 'utf8'
items = no
process = (action, value) ->
return "Commands: open, add, process" unless action in ["open", "add", "process"]
if action == "open"
return "order already exists" if items
@Ficik
Ficik / gist:5182950
Created March 17, 2013 18:30
w20-2-komunikace
Stateless
=========
< open
> order token not specified
< open my_order
> opened
< add my_order something
> added
< process
> orden token not specified
@Ficik
Ficik / gist:5194162
Created March 19, 2013 06:44
w20-cv3
storage =
books:
1:
"name" : "Nazev"
"isbn" : "123556"
"publisher" : "/publisher/1"
"author" : "/author/2"
2:
"name" : "Nazev"
"isbn" : "123556"
@Ficik
Ficik / gist:5232332
Last active December 15, 2015 08:39
w20-cv5
http = require "http"
crypto = require "crypto"
hash = (text) -> crypto.createHash("md5").update(text).digest("hex")
all = (array, fn) ->
for value in array
return false unless fn(value)
return true
any = (array, fn) ->
for value in array
@Ficik
Ficik / gist:5280871
Last active December 15, 2015 15:19
w20-6-atompub
<?xml version="1.0" ?>
<app:service
xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:metadata="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:data="http://schemas.microsoft.com/ado/2007/08/dataservices">
<app:workspace href="http://store.it/users/432/albums/">
<title>Peter Novak's albums</title>
<app:collection href="http://store.it/users/432/albums/635/">
<title>Trip to Prague></title>
@Ficik
Ficik / monokai.sh
Created November 30, 2013 22:48
Monokai theme (colors as in sublime-text-2) for guake and gnome-terminal. Just copypaste to terminal
# Guake:
COLORS="#272728282222:#ffff29292929:#a6a6e2e22e2e:#e6e6dbdb7474:#6666d9d9efef:#f9f926267272:#bebe8484ffff:#fefefffffefe:#757571715e5e:#ffff29292929:#a6a6e2e22e2e:#fdfd97971f1f:#6666d9d9efef:#f9f926267272:#aeae8181ffff:#fefefffffefe"
FOREGROUND="#F6F6F5F5EEEE"
BACKGROUND="#232325252626"
gconftool-2 -s -t string /apps/guake/style/background/color $BACKGROUND
gconftool-2 -s -t string /apps/guake/style/font/palette $COLORS
gconftool-2 -s -t string /apps/guake/style/font/color $FOREGROUND
@Ficik
Ficik / change_making_problem.rb
Last active December 31, 2015 08:19
ChangeMakingProblem solver
class ChangeMakingProblem
attr_reader :values, :target
def initialize(values)
# sorting is not nesesary, but has good impact on speed
@values = values.sort.reverse
end
def solve(target)