Skip to content

Instantly share code, notes, and snippets.

View whoeverest's full-sized avatar

Andrej T. whoeverest

  • Skopje, Republic of Macedonia
View GitHub Profile
@whoeverest
whoeverest / gist:2984175
Created June 24, 2012 17:54
How girls respond to quesions (in code)
# How women respond to questions
print \
"1. How it should look like:"
def ask_a_question(question):
taste = {
"apples":True,
"oranges":False
}
if "like" in question:
@whoeverest
whoeverest / gist:3062336
Created July 6, 2012 19:40
Pulses from .wav
import wave
import sys
if len(sys.argv) > 2:
path = sys.argv[1]
else:
path = "/home/whoeverest/code/klima-reverse/16c.wav"
wav = wave.open(path)
@whoeverest
whoeverest / gist:3756161
Created September 20, 2012 14:08
Andrej T. / Skills
Листа на skill-ови / Андреј Т.
------------------------------
Програмски јазици:
- Python 4/5
- PHP 3/5
- HTML/CSS 3/5
- JavaScript 2/5
- C/C++ 1/5
- Java 1/5
@whoeverest
whoeverest / gist:3756559
Created September 20, 2012 15:21
Distributed Source
def add(a, b):
return a + b + 100
def add(a, b):
return a + b
def subtract(a, b):
return a - b
@whoeverest
whoeverest / gist:3767564
Created September 22, 2012 19:43
Self-sync
import synchronize
import matz
print matz.add(2,3)
print matz.add(3,3)
@whoeverest
whoeverest / gist:3807595
Created September 30, 2012 16:59
Directory mapper
import os
from collections import defaultdict
class DB(object):
def __init__(self, location, columns):
self.location = location # path to the location
self.columns = columns # names of the table columns
self.data = []
@whoeverest
whoeverest / gist:3839897
Created October 5, 2012 13:50
undefined projectImages
function DisplayImageCtrl($scope, $routeParams, API) {
var projectImages = null;
API.get({projectId: $routeParams.projectId}, function(data) {
projectImages = data['images'];
})
for (var i=0; i < projectImages.length; ++i) {
if (projectImages[i]['image_id'] == imageId) {
import os
def songs_from_playlist(path):
return open(playlist).readlines()
songs_folder = "/home/whoeverest"
playlist = "/home/whoeverest/lista.m3u"
songs = songs_from_playlist(playlist)
@whoeverest
whoeverest / gist:3872126
Created October 11, 2012 13:03
cols and rows
from collections import deque
from random import shuffle, randint
from time import time
def t(msg=None, times=[]):
""" Timing function."""
t = time()
if times and msg:
print msg, t - times[0]