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 / 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
@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 / .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 / 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 / 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 / cyberpunk.el
Created March 14, 2013 13:07
emacs themes i want for vim
;; Cyberpunk Colour Theme
;;
;; "and he'd still see the matrix in his sleep, bright lattices of logic
;; unfolding across that colorless void..."
;; William Gibson, Neuromancer.
;;
(require 'color-theme)
;;;###autoload
package stringcase
import "testing"
func equal(a, b []string) bool {
if len(a) != len(b) {
return false
}
for i, v := range a {
if v != b[i] {
@pvinis
pvinis / gist:7840124
Created December 7, 2013 11:38
shell
func (sh *Shell) Loop() {
sc := bufio.NewScanner(os.Stdin)
printPrompt()
for sc.Scan() {
line := sc.Text()
if line == "start" || line == "st" {
sh.startStop <- true
} else if line == "stop" {
sh.startStop <- false
} else if line == "exit" {
#![feature(associated_types)]
extern crate time;
fn main() {
println!("hello :)");
//println!("{}", time::now());
}
@pvinis
pvinis / gist:f93b2e1c04664e78c493
Created May 15, 2015 08:42
opencl-device-detect
#include <stdio.h>
#include <stdlib.h>
#include <OpenCL/opencl.h>
int main(int argc, char* const argv[]) {
cl_uint num_devices, i;
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
cl_device_id* devices = calloc(sizeof(cl_device_id), num_devices);