Skip to content

Instantly share code, notes, and snippets.

Setup zoals ik het voor vader heb gemaakt:
Telenet (POP)
Een nieuwe gmail account (IMAP)
In die gmail account kan je opzetten dat hij ook een POP-account moet leegtrekken (dus ook de nieuwe mail altijd ophaalt). Vanaf nu komt al die Telenet-mail ook binnen op je gmail.
Nu kan je in gmail ook opzetten dat je vanaf een ander adres wilt versturen (dus hier gebruik je terug je Telenet adres als verzender). Nu lijkt het voor de buitenwereld of je op die Telenet account zit maar kan je wel gebruik maken van alle goodies van Gmail (IMAP, degelijke webmail, goede iPhone support) en heb je ook nog als bijkomend voordeel (stel dat je de gmail geheim houdt) dat je heel vlot kunt wisselen van email-adres (je mail blijft dan op hetzelfde (geheime) adres).
@pjaspers
pjaspers / gist:388544
Created May 3, 2010 20:27
Check the wk snookerfinal score
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'hpricot'
doc = open("http://news.bbc.co.uk/sport2/hi/other_sports/snooker/8620811.stm") { |f| Hpricot(f) }
puts (doc/"td.storybody").at("p:nth(4)").to_plain_text
@pjaspers
pjaspers / basicworkflow
Created May 8, 2010 14:33
Git basic workflow
We (http://10to1.be) 're heavy github users so I'm going to inlcude them in the workflow (feel free to replace them with another server).
Github repo is containing the project
1. Make sure you are in the master branch
2. Do a pull.
3. Create a branch to do your work in (git checkout -b "solving_the_bug")
4. Do your work.
5. Switch back to the master branch (git checkout master)
6. Do a pull (git pull) --this to make sure the master branch is up to date.
@pjaspers
pjaspers / jelle.rb
Created May 11, 2010 08:14
Getting @fousa's standing in the gliding competition
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'hpricot'
doc = open("http://www.lvzc.be/charronline/2010/klassement_benelux.php?list=standaard") { |f| Hpricot(f) }
def print_nicely(tr)
current_standing = tr.at("td:nth(0)").inner_html
name = tr.at("td:nth(1)").inner_html
@pjaspers
pjaspers / xauth.sh
Created May 20, 2010 19:55
An attempt to do xauth in a shell script.
function xauth(){
NONCE=`head -n 64 /dev/urandom | env LC_CTYPE=C tr -dc 0-9 | cut -c1-64`
TIMESTAMP=`date +%s`
# signature base string
# POST&https%3A%2F%2Fapi.twitter.com%2Foauth%2Faccess_token&oauth_consumer_key%3Dri8JxYK2ZdwSV5xIUfNNvQ%26oauth_nonce%3DqfQ4ux5qRH9GaH8tVwDCwInLy6z8snR6wiq8lKcD6s%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1267817662%26oauth_version%3D1.0%26x_auth_mode%3Dclient_auth%26x_auth_password%3Dxyz12242134%26x_auth_username%3Depisod
consumer_key="6tV0bqiCWFPVQDSqUW6kMw"
consumer_secret="wnqkvIv9AMeeFoWJttIhRXxPQNewRXNs2bAYa6j8U"
key="${consumer_secret}&"
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif
#ifdef DEBUG
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#ifndef NS_BLOCK_ASSERTIONS
#!/usr/bin/ruby
# update_version.rb
#
# Created by Piet Jaspers on 23/07/10.
# Copyright 2010 10to1. All rights reserved.
require "rubygems"
require "Plist"
- (void)liveRequest:(ASIHTTPRequest *)request didReceiveData:(NSData *)data {
NSString *aString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(\\{.*?\\})"options:NSRegularExpressionCaseInsensitive error:&error];
[regex enumerateMatchesInString:aString options:0 range:NSMakeRange(0, [aString length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop){
//DLog(@"Our Range %@", NSStringFromRange(match.range));
//DLog(@"Text %@", [aString substringWithRange:match.range]);
[Parser parserWithResponse:[aString substringWithRange:match.range] delegate:self andRequest:request];
}];
}
# Source: http://twitter.com/rentzsch/status/11677309429874688
curl -o ~/Library/Sounds/inception.mp3 http://inception.davepedu.com/inception.mp3 && defaults write com.apple.Xcode PBXBuildFailureSound ~/Library/Sounds/inception.mp3
ldfsljksfdlkj