Skip to content

Instantly share code, notes, and snippets.

View pvinis's full-sized avatar
🔭
hello?

Pavlos Vinieratos pvinis

🔭
hello?
View GitHub Profile
@pvinis
pvinis / gist:4979592
Created February 18, 2013 18:41
my vimrc
" pvinis
""" Intro
set nocompatible " viMproved
" Needed for vundle, will be turned on after vundle inits
filetype off
" Setup vundle
@pvinis
pvinis / gist:3901445
Created October 16, 2012 19:30
recenter vim search
nnoremap n n:call Recenter(15)<CR>
nnoremap N N:call Recenter(15)<CR>
function! Recenter(tolerance)
if (abs(winline()-winheight(0)/2)>a:tolerance)
exe 'norm! zz'
endif
endfunction
@pvinis
pvinis / .zshrc
Created September 27, 2012 01:22
shell recording
# for spyshell
function zshexit() {
cat /Users/`whoami`/.termlogs/`date +%Y-%m-%d`.txt | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > temp
mv temp /Users/`whoami`/.termlogs/`date +%Y-%m-%d`.txt
exit
}
@pvinis
pvinis / rubygame2
Created December 20, 2011 11:28
rubygame2
s = 1
gifts.split("\n")[-day..-2].each{|l| s += l.to_i}
s
@pvinis
pvinis / video_mustachify
Last active April 7, 2016 16:53
video mustachify
framework 'Cocoa'
framework 'avfoundation'
class FaceDetectionDelegate
attr_accessor :window
def applicationDidFinishLaunching(aNotification)
width = 1280
height = 720
#!/usr/local/bin/macruby
framework 'Cocoa'
framework 'AVFoundation'
# because we love blocks, we make NSTimer blocks :-)
class NSTimer
def self.scheduledTimerWithTimeInterval interval, repeats: repeat_flag, block: block
self.scheduledTimerWithTimeInterval interval,
target: self,
selector: 'executeBlockFromTimer:',
@pvinis
pvinis / face_detector.rb
Created December 7, 2011 12:06
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
def ok
a = []
end
"package_name_map": {
"soda-theme": "Theme - Soda"
}
}