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
| 13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| | FUCKIN PUSSIES | |
| 13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
| 13:16 <luite> | hello | |
| 13:16 <ChongLi> | somebody has a mental illness! | |
| 13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| | compelled to write Node.js! | |
| 13:16 <genisage> | hi | |
| 13:16 <luite> | you might be pleased to learn that you can compile | |
| | haskell to javascript now |
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 random import shuffle | |
| slices = [1,2,3] * 4 + [20, 25, 30] * 2 | |
| shuffle(slices) | |
| fig = plt.figure(figsize=[10, 10]) | |
| ax = fig.add_subplot(111) | |
| cmap = plt.cm.prism | |
| colors = cmap(np.linspace(0., 1., len(slices))) |
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
| #!/usr/bin/env python3 | |
| # -*- mode: python -*- | |
| # This program is free software. It comes without any warranty, to the extent | |
| # permitted by applicable law. You can redistribute it and/or modify it under | |
| # the terms of the Do What The Fuck You Want To Public License, Version 2, as | |
| # published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more | |
| # details. | |
| # Some useful resources: |
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
| #!/usr/bin/env python3 | |
| def crc(msg, div, code='000'): | |
| """Cyclic Redundancy Check | |
| Generates an error detecting code based on an inputted message | |
| and divisor in the form of a polynomial representation. | |
| Arguments: | |
| msg: The input message of which to generate the output code. |
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
| #In form.py | |
| #The original source for this : http://djangosnippets.org/snippets/1303/ | |
| from django import forms | |
| from django.template.defaultfilters import filesizeformat | |
| from django.utils.translation import ugettext_lazy as _ | |
| # 2.5MB - 2621440 | |
| # 5MB - 5242880 | |
| # 10MB - 10485760 |
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
| """A basic database set-up for Travis CI. | |
| The set-up uses the 'TRAVIS' (== True) environment variable on Travis | |
| to detect the session, and changes the default database accordingly. | |
| Be mindful of where you place this code, as you may accidentally | |
| assign the default database to another configuration later in your code. | |
| """ | |
| import os |
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
| # Thomas Parslow http://almostobsolete.net | |
| # Just a work in progress and adapted to what I need right now. | |
| # It does uploads (via a file-like object that you write to) and | |
| # I've started on downloads. Needs the development version of Boto from Github. | |
| # | |
| # Example: | |
| # | |
| # glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) | |
| # writer = GlacierWriter(glacierconn, GLACIER_VAULT) | |
| # writer.write(somedata) |
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
| A warning occurred (42 apples) | |
| An error occurred |
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
| pg_restore --clean --no-acl --no-owner -d <database> -U <user> <filename.dump> |
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 xhr = function() { | |
| var xhr = new XMLHttpRequest(); | |
| return function( method, url, callback ) { | |
| xhr.onreadystatechange = function() { | |
| if ( xhr.readyState === 4 ) { | |
| callback( xhr.responseText ); | |
| } | |
| }; | |
| xhr.open( method, url ); | |
| xhr.send(); |