Skip to content

Instantly share code, notes, and snippets.

View mfilej's full-sized avatar

Miha Filej mfilej

View GitHub Profile
@mfilej
mfilej / autoexec.cfg.txt
Last active October 10, 2015 17:57
dota 2 net graph positioning on a crappy 1024x768 resolution
con_enable "1"
net_graphheight 64
net_graphpos 1
net_graphproportionalfont 0
net_graphtext 1
net_graphinsetleft 145
net_graphinsetbottom 0
net_graphinsetright 0
net_graphinsettop -422
@mfilej
mfilej / rand.rb
Created April 5, 2012 15:32
Generate unique sequences comprised of 3 random letters and 3 random numbers
#! /usr/bin/env ruby
require "set"
def rand_seq(len = 6)
"".tap { |seq| len.times { seq << rand(36).to_s(36).upcase } }
end
puts Set.new.tap { |s| s << rand_seq while s.size < 10_000 }.to_a
@mfilej
mfilej / Info.plist
Created January 16, 2012 10:13
Make Safari open links from other applications in current space
<key>CFBundleIdentifier</key>
<string>com.apple.AppleScript.SafariURLHelper</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>SafariURLHelper</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
@mfilej
mfilej / gist:1527529
Created December 28, 2011 10:44
mp4box install log
==> Downloading http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz
File already downloaded in /Users/miha/Library/Caches/Homebrew
/usr/bin/tar xf /Users/miha/Library/Caches/Homebrew/gpac-0.4.5.tar.gz
==> chmod +x configure
chmod +x configure
==> ./configure --disable-wx --prefix=/usr/local/Cellar/gpac/0.4.5 --mandir=/usr/local/Cellar/gpac/0.4.5/share/man --extra-ldflags=-L/usr/X11/lib --use-ffmpeg=no --use-openjpeg=no
./configure --disable-wx --prefix=/usr/local/Cellar/gpac/0.4.5 --mandir=/usr/local/Cellar/gpac/0.4.5/share/man --extra-ldflags=-L/usr/X11/lib --use-ffmpeg=no --use-openjpeg=no
** System Configuration
@mfilej
mfilej / mkv2m4v.sh
Created December 28, 2011 10:22
mkv to m4v
# demux
mkvextract tracks ${BASE}.mkv 1:${BASE}.ac3 2:${BASE}.264
# convert audio
ffmpeg -i ${BASE}.ac3 -acodec libfaac -ab 576k ${BASE}.aac
# or
ffmpeg -i ${BASE}.ac3 -vn -r 30000/1001 -acodec libfaac -ac 6 -ar 48000 -ab 448k ${BASE}.aac
# mux
MP4Box -add ${BASE}.264:fps=23.976 -add ${BASE}.aac ${BASE}.m4v
@mfilej
mfilej / Gemfile
Created July 4, 2011 11:52
inspect-headers.herokuapp.com – prints HTTP request headers (an excuse to try out heroku cedar)
source :rubygems
gem "rack", "~> 1.3.0"
gem "thin", "~> 1.2.7"
@mfilej
mfilej / Character Viewer.scpt
Created June 19, 2011 09:26
Open OS X's Character Viewer via AppleScript (10.6)
tell application "Finder"
open item "System:Library:Input Methods:CharacterPalette.app" of the startup disk
end tell
@mfilej
mfilej / n1.prolog
Created June 15, 2011 12:20
PPJ izpit 2011-03-30
% Napišite predikat linked(Node1, Node2, Path), ki drži takrat, ko med
% vozliščema Node1 in Node2 nekega grafa obstaja pot Path. Poskrbite tudi, da
% se vaš program nekako izogne neskončnemu ciklanju. Povezave med vozlišči v
% grafu so podane s predikatom link(Node1, Node2), ki pove, da obstaja
% povezava med vozliščema Node1 in Node2. Smer povezave določa vrstni red
% vozlišč v predikatu link/2, v danem primeru je povezava od vozlišča Node1 do
% vozlišča Node2.
%
% Primer grafa in njegovega zapisa v prologu je podan spodaj.
%
@mfilej
mfilej / gist:784300
Created January 18, 2011 11:28
mencoder: avi to dvd video with hard subs
mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf harddup -lavcopts aspect=16/9:vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=4281:keyint=15:vstrict=0 -ofps 25 -sub BlackCatWhiteCat.srt -subalign 2 -subpos 100 -subcp utf-8 -o dvdsub.mpg crna.avi
@mfilej
mfilej / gist:588475
Created September 20, 2010 19:17
Move the newest screen grab (png file) from the desktop to Dropbox (LaunchBar action)
#! /usr/bin/ruby
require "pathname"
require "fileutils"
require "uri"
def large_type(string)
msg = URI.encode(string)
system "open x-launchbar:large-type?string=#{msg}"
end