Skip to content

Instantly share code, notes, and snippets.

View tadelv's full-sized avatar
💭
🦙

Vid Tadel tadelv

💭
🦙
View GitHub Profile
@tadelv
tadelv / twitteggester.rb
Created April 10, 2010 20:43
a dumb script if you are bored and don't know who to follow on twitter
#!/usr/bin/env ruby
# Analyzes your twitter friends if they are following someone interesting
# akshully it just shows you, who has the most many followers
# usage: ./twitteggester.rb <username> <how many followers to research>
#
# works by reading your twitter page (the span class vcard)
require "rubygems"
require "open-uri"
require "rubygems"
#list through the current folder and call git pull on each repository
home = ARGV[0] == nil ? Dir.pwd : ARGV[0]
home_d = Dir.open(home)
home_count = home_d.count
c_idx = 1
home_d.each do |current|
#podaj vektor atributov, katere
#funkcija odstrani iz dataseta in izracuna napovedi
#atributi so podani z indeksom (da jih lazje odstranimo)
odstrani.atr.in.izr.napovedi <- function(dataset, attributes, model, formula, ...) {
cat("OHAI!1!\n")
results <- ""
predictions <- ""
for(i in 1:length(attributes)) {
pr <- izracunaj.napovedi(formula, model, dataset[,-attributes[i]],...)
#predictions <- c(predictions,pr)
@tadelv
tadelv / Debug.h
Created July 15, 2010 07:24
a verbose NSLog
#import <Foundation/Foundation.h>
#ifdef DEBUG
#define DebugLog( xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DebugLog( s, ... ) ((void)0)
#endif
@tadelv
tadelv / dSYM_to_storage.sh
Created July 19, 2010 11:54
Store dSYM files in a folder and add to git
#!/bin/sh
#
# http://www.cimgf.com/2009/12/23/automatically-save-the-dsym-files/
#
if [ "$BUILD_STYLE" == "Debug" ]; then
echo "Skipping debug"
exit 0;
fi
@tadelv
tadelv / iOS4Check.h
Created July 21, 2010 09:35
Macro for conditional code compilation depending on OS versions in iOS
//
// iOS4Check.h
//
// Thank you:
// http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html
//
// Created by Vid Tadel on 7/9/10.
//
#import <UIKit/UIKit.h>
@tadelv
tadelv / Debug.h
Created August 13, 2010 12:59
Awesome debug
//Debug.h
#import <Foundation/Foundation.h>
#ifdef DEBUG
#define DebugLog( xx, ...) _DebugLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DebugLog( s, ... ) ((void)0)
#endif
@tadelv
tadelv / multipleARCH.sh
Created December 20, 2010 20:53
script for building multiple arch builds at once
# Purpose:
# Create a static library for iPhone from within XCode
# Because Apple staff DELIBERATELY broke Xcode to make this impossible from the GUI (Xcode 3.2.3 specifically states this in the Release notes!)
# ...no, I don't understand why they did such a stupid thing either!
#
# Author: Adam Martin - http://twitter.com/redglassesapps
# Based on: original script from Eonil (main changes: Eonil's script WILL NOT WORK in Xcode GUI - it WILL CRASH YOUR COMPUTER)
#
# More info: see this Stack Overflow question: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
@tadelv
tadelv / slo_gas_price_scraper.rb
Created January 11, 2011 14:30
plz don't kill me, i don't know how to write code
require 'rubygems'
require 'open-uri'
require "hpricot"
html = open('http://www.amzs.si/?podrocje=18').read
doc = Hpricot(html)
count_ary = (doc/"td.DefaultTemplate/table/tr").to_ary
countries = count_ary[3..41]
@tadelv
tadelv / perfectelementary.bash
Created December 23, 2015 10:46
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'