Skip to content

Instantly share code, notes, and snippets.

@ddksr
ddksr / random_file
Created September 11, 2014 20:29
Recursive random file
#!/bin/bash
dir="directory" # no slash at end
files=$(ls -R $dir | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }');
list=();
while read -r line; do
list[${#list[@]}]=$line;
@ddksr
ddksr / daemons-arch-full.xml
Created September 21, 2014 10:17
Service monitor Archlinux sources
<services>
<name>Daemons (Full Arch-specific config)</name>
<description>
This file contains a more detailed source for archlinux (or maybe systemd) specific services.
</description>
<service id="apache2-daemon-arch" priority="2" sudo="yes" icon="apache">
<name>Apache2 Webserver</name>
@ddksr
ddksr / london.org
Created January 7, 2015 20:25
London sighseeing plan for 3.5 days

London plan

Museums

  • [ ] British Museum (4h)
  • [ ] Natural History Museum (6h)
  • [ ] Tate Modern (4h)
  • [ ] Science Museum (4h)

Nature

  • [ ] London Zoo (6h)
  • [ ] St James Park (1h)

Sights (max 15min each)

@ddksr
ddksr / mucl.zsh-theme
Created January 9, 2015 16:12
ZSH prompt
# Oh-my-Zsh prompt created by sigi
# The theme is based on gianu but has things I really wanted to have
# Also, note this great article: http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
@ddksr
ddksr / pjson.py
Last active August 29, 2015 14:13
Script for parsing jsons in bash
#!/bin/python
"""
pjson - simple script for parsing jsons with python
Json input needed with stdin.
Usage:
pjson key1 key2 key3 ...
Examples:
@ddksr
ddksr / termania.py
Created February 1, 2015 11:38
Termania script
#!/usr/bin/env python3
"""Termania api
Usage:
termania [options] [QUERY [QUERY ...]]
Options:
-h --help Show this screen.
--version Show version.
"""
@ddksr
ddksr / dis.py
Created February 1, 2015 11:38
DIS script
#!/usr/bin/env python3
"""DIS slovarček api
Usage:
dis [options] [QUERY [QUERY ...]]
Options:
-h --help Show this screen.
--version Show version.
"""
@ddksr
ddksr / izpiski.org
Created February 7, 2015 16:11
CVWW presentation

Highlights

  • multi-image photogrammetry is becoming the most accurate and cost effective method of documentation in underwater archeology
  • a 3d point cloud is difficult to use directly for analysis and comparison of object shapes
  • volumetric shape models can address some of this difficulties
  • superquadric volumetric shape models can be automatically recovered from a point cloud
  • superquadric models offer an abstraction level suitable for reasoning about a scene

Intro

  • stereo and photogrammetry in 1960s George Bass
  • 3D available only after the field work was already finished
  • documentation performed mostly manually - imperfections

Uvod

  • [x] predstavi se
  • [x] prilagajanje wp-ja: teme in plugini. razlika?
    • [x] actions
    • [x] filters
    • [x] the loop

Teme

  • [x] style.php - metapodatki teme
  • [x] functions.php - programerske nastavitve teme
    • [x] poglej featured image
@ddksr
ddksr / bash-snippets.sh
Last active November 17, 2015 14:56
Favorite bash snippets
# In a file with urls, count different status codes
{ for line in `cat urls.txt`; do curl -I $line 2> /dev/null | head -n 1 | egrep -o '[0-9]{3}' ; done; } | sort | uniq -c
# Get titles from urls from clipboard
urls=`xclip -o | tr '\n' ' '`; for url in $(echo $urls); do clean_url=$(echo -e "${url}" | tr -d '[[:space:]]'); tmp=$(curl "$clean_url" 2> /dev/null | egrep -o '<title>.*</title>' | egrep -o '>.*<'); echo ${tmp:1:-2}; done;