Skip to content

Instantly share code, notes, and snippets.

View dbrgn's full-sized avatar

Danilo Bargen dbrgn

View GitHub Profile
# -*- coding: utf-8 -*-
"""
Tracing the twitter chain, down the rabbit hole.
Dependencies:
- requests
- beautifulsoup4
"""
2014-02-12 14:01:35 @aendu: Ich frage mich ja, wo die Wurzel DIESES Übels liegt. https://twitter.com/madmenna/status/433585834193715200 …
2014-02-12 13:58:13 @MadMenNa: Entschuldigung, aber das geht definitiv zu weit. https://twitter.com/andbhold/status/433563855596556289 …
2014-02-12 12:30:53 @andbhold: Jetzt fängt der @Ugugu auch noch an damit: https://twitter.com/Ugugu/status/433563375721660417 …
2014-02-12 12:28:58 @Ugugu: spinnen jetzt alle? https://twitter.com/patman27/status/433559982853066752 …
2014-02-12 12:15:29 @patman27: krass!!
https://twitter.com/sixtus/status/433558970494496768 …
2014-02-12 12:11:28 @sixtus: Boah! Nerv! Und jetzt auch noch das! https://twitter.com/ReichelS/status/433557896753082368 …
2014-02-12 12:07:12 @ReichelS: genau das ist der grund, warum twitter vor die hunde geht: https://twitter.com/mspro/status/433556778983624704 …
2014-02-12 12:02:45 @mspro: orrr, muss das sein? https://twitter.com/totalreflexion/status/433543227249926144 …
2014-02-12 11:08:54 @totalreflexion: Warum
@dbrgn
dbrgn / 1.js
Created February 3, 2014 14:18
> var name = 'World!';
undefined
> (function () {
... if (typeof name === 'undefined') {
..... console.log('Goodbye ' + name);
..... } else {
..... console.log('Hello ' + name);
..... }
... })();
Hello World!
@dbrgn
dbrgn / gist:8336449
Last active January 2, 2016 17:19
IntTe HS2012 Aufgabe 6.3
/* Person class */
function Person() { }
Person.prototype.toString = function() {
return this.firstName + ", " + this.lastName;
}
/* Student class */
@dbrgn
dbrgn / intreduce.go
Created November 28, 2013 23:11
An integer reduce function in Go.
package main
import "fmt"
// reduce() function
func Reduce(f func(int, int) int, collection []int, init int) int {
value := init
for _, item := range collection {
value = f(value, item)
@dbrgn
dbrgn / gist:7451806
Last active December 28, 2015 05:39
Fetch current bitcoin prices with Go.
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/json"
)
const baseUrl = "http://data.mtgox.com/api/2/%s/money/ticker"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Social auth
AUTHENTICATION_BACKENDS = ('social_auth.backends.google.GoogleOAuth2Backend',)
LOGIN_URL = '/auth/login/'
LOGIN_REDIRECT_URL = '/'
LOGIN_ERROR_URL = '/auth/login-error/'
GOOGLE_OAUTH2_CLIENT_ID = require_env('GOOGLE_OAUTH2_CLIENT_ID')
GOOGLE_OAUTH2_CLIENT_SECRET = require_env('GOOGLE_OAUTH2_CLIENT_SECRET')
GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'access_type': 'offline'}
GOOGLE_OAUTH_EXTRA_SCOPE = [
'https://adwords.google.com/api/adwords',
@dbrgn
dbrgn / gist:6078111
Created July 25, 2013 09:15
Shorter / less clean version of geekweek
code = '53 65 61 72 63 68 20 59 6f 75 54 75 62 65 20 66 6f 72 20 2f 20 67 65 65 6b 77 65 65 6b'
print ''.join(map(chr, [int(val, base=16) for val in code.split()]))
@dbrgn
dbrgn / gist:6078106
Created July 25, 2013 09:13
google geekweek
from functools import partial
hexint = partial(int, base=16)
code = '53 65 61 72 63 68 20 59 6f 75 54 75 62 65 20 66 6f 72 20 2f 20 67 65 65 6b 77 65 65 6b'
numbers = map(hexint, code.split())
print ''.join(map(chr, numbers))