1
Name:
Anonymous
2013-02-08 12:57
I'm wrapping up my second year of CS undergrad and I'm starting to burn out a bit. My goal is to get my degree and live the "digital nomad" lifestyle, moving from country to country every couple of months (after a year or two of workplace experience/credential building).
I've heard that it's actually pretty hard to survive off of online freelance projects alone, as a lot of people want to meet in person and the good jobs require niche specializations.
Is this a realistic aspiration? Could I support myself without an office job?
31
Name:
Anonymous
2013-02-20 10:15
Get the Culver on your home computer.
(use irregex srfi-1 tcp)
(define (get-image page)
((lambda (x)
(if x
(string-append
(substring x 0 (- (string-length x) 6)) ".jpg") #f))
(find (lambda (x) (irregex-search "_m.jpg" x))
(irregex-split "\"" page))))
(define (get-newer page)
((lambda (s)
(if s (string-append "http://www.flickr.com " s) #f))
(find (lambda (x) (irregex-search "photosof" x))
(irregex-split "\'" page))))
(define (write-file path data)
(with-output-to-file path
(lambda () (write-string data))))
(define (get-page uri)
(define (connect host port)
(call-with-values (lambda () (tcp-connect host port)) list))
(define (ftake lst a)
(if (or (null? lst) (eqv? a (car lst))) '()
(cons (car lst) (ftake (cdr lst) a))))
(define (fdrop lst a)
(if (or (null? lst) (eqv? a (car lst))) lst
(fdrop (cdr lst) a)))
(define (get-hostname uri)
(list->string (ftake (cddr (fdrop (string->list uri) #\/)) #\/)))
(define (get-document uri)
(list->string (fdrop (cddr (fdrop (string->list uri) #\/)) #\/)))
(define (strip-header str)
(define (strip-header-aux lst)
(cond ((null? (cddr lst)) #f)
((and (char=? (car lst) #\newline)
(char=? (cadr lst) #\return)
(char=? (caddr lst) #\newline)) (cdddr lst))
(else (strip-header-aux (cdr lst)))))
(if (< (string-length str) 3) #f
(list->string (strip-header-aux (string->list str)))))
((lambda (server document)
(apply
(lambda (reader writer)
(display
(string-append "GET " document " HTTP/1.1\r\n"
"Host: " server "\r\n"
"Connection: close\r\n\r\n")
writer)
(strip-header (read-string #f reader)))
(connect server 80)))
(get-hostname uri) (get-document uri)))
(define (fetch-the-culver newest oldest)
(define (right-in-the-culver n page uri)
((lambda (image-uri file-path)
(display (string-append image-uri " -> " file-path "\n"))
(write-file file-path (get-page image-uri)))
(get-image page)
(string-append "culver" (number->string n) ".jpg"))
(if (not (string=? uri newest))
((lambda (uri)
(right-in-the-culver (+ n 1) (get-page uri) uri))
(get-newer page))))
(right-in-the-culver 1 (get-page oldest) oldest))
(fetch-the-culver
"http://www.flickr.com/photos/adactio/5155673220/in/photosof-leahculver/ "
"http://www.flickr.com/photos/thomashawk/3263299572/in/photosof-leahculver/ ")
(Got into a fight with http-client, hence the weird get-page procedure)