This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Tracing the twitter chain, down the rabbit hole. | |
| Dependencies: | |
| - requests | |
| - beautifulsoup4 | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > var name = 'World!'; | |
| undefined | |
| > (function () { | |
| ... if (typeof name === 'undefined') { | |
| ..... console.log('Goodbye ' + name); | |
| ..... } else { | |
| ..... console.log('Hello ' + name); | |
| ..... } | |
| ... })(); | |
| Hello World! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Person class */ | |
| function Person() { } | |
| Person.prototype.toString = function() { | |
| return this.firstName + ", " + this.lastName; | |
| } | |
| /* Student class */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)) |