Skip to content

Instantly share code, notes, and snippets.

@nebjak
nebjak / app.coffee
Last active October 13, 2015 01:28
Whrite Node.js apps in CoffeeScript
http = require 'http'
server = http.createServer (req, res) ->
res.end 'Hello World\n'
server.listen 3000
@nebjak
nebjak / gif-ify.sh
Created January 23, 2013 14:49
Convert a video to a gif
gif-ify() {
if [[ -n "$1" && -n "$2" ]]; then
ffmpeg -i $1 -pix_fmt rgb24 temp.gif
convert -layers Optimize temp.gif $2
rm temp.gif
else
echo "proper usage: gif-ify <input_movie.mov> <output_file.gif>. You DO need to include extensions."
fi
}
for f in *; do mv $f `echo $f | tr '[:upper:]' '[:lower:]'`; done
@nebjak
nebjak / wma2ogg.sh
Created May 13, 2013 06:44
Convert .wma audio files to .ogg to subdirectory *ogg*
for i in *.wma; do ffmpeg -i $i -codec:a libvorbis -qscale:a 5 ogg/${i%.wma}.ogg; done
@nebjak
nebjak / wma2mp3.sh
Created May 13, 2013 06:45
Convert .wma audio files to .mp3 to subdirectory *mp3*
for i in *.wma; do ffmpeg -i $i mp3/${i%.wma}.mp3; done
@nebjak
nebjak / serbia_zip_codes.json
Last active December 23, 2024 15:53
List of Serbia zip codes with cities in form of JSON array
[
{ "city" : "Beograd", "_id" : 11000 },
{ "city" : "Beograd Vozdovac", "_id" : 11010 },
{ "city" : "Beograd Čukarica", "_id" : 11030 },
{ "city" : "Beograd Zvezdara", "_id" : 11050 },
{ "city" : "Beograd Palilula", "_id" : 11060 },
{ "city" : "Novi Beograd", "_id" : 11070 },
{ "city" : "Beograd Zemun", "_id" : 11080 },
{ "city" : "Beograd Rakovica", "_id" : 11090 },
{ "city" : "Kaluđerica", "_id" : 11130 },
@nebjak
nebjak / serbia_zip_codes2.json
Created May 20, 2013 11:24
List of Serbia zip codes with cities in form of one JSON object per line
{ "city" : "Beograd", "_id" : 11000 }
{ "city" : "Beograd Vozdovac", "_id" : 11010 }
{ "city" : "Beograd Čukarica", "_id" : 11030 }
{ "city" : "Beograd Zvezdara", "_id" : 11050 }
{ "city" : "Beograd Palilula", "_id" : 11060 }
{ "city" : "Novi Beograd", "_id" : 11070 }
{ "city" : "Beograd Zemun", "_id" : 11080 }
{ "city" : "Beograd Rakovica", "_id" : 11090 }
{ "city" : "Kaluđerica", "_id" : 11130 }
{ "city" : "Rušanj", "_id" : 11194 }
@nebjak
nebjak / serbia_zip_codes.csv
Last active December 4, 2017 14:13
List of Serbia zip codes with cities in CSV
zip_code city
11000 Beograd
11010 Beograd Vozdovac
11030 Beograd Čukarica
11050 Beograd Zvezdara
11060 Beograd Palilula
11070 Novi Beograd
11080 Beograd Zemun
11090 Beograd Rakovica
11130 Kaluđerica
@nebjak
nebjak / NBS-pretraga-racuna
Created May 31, 2013 16:24
Pretraga računa preko Nardodne Banke Srbije
Osnovni URL
-----------
http://www.nbs.rs/rir_pn/pn_rir.html.jsp?type=rir_results&lang=SER_CIR&konverzija=yes&
Moguća pretrga po
-----------------
--------------------------------------------
| Podatak | ključ |
--------------------------------------------
@nebjak
nebjak / CompanyFactory.rb
Created July 3, 2013 09:45
FactoryGirl definicija :-)
FactoryGirl.define do
factory :company do
naziv "Test Company doo za proizvodnju, promet i usluge"
skraceni_naziv "Test Company doo"
pib "101010101"
mb "10101010"
adresa "Palih programera 64b"
mesto
ptt_broj
pak "101010"