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
| # based on http://django-filer.readthedocs.org/en/0.9.2/upgrading.html#from-pre-0-9a3-develop-to-0-9 | |
| import sys, os | |
| from django.conf import settings | |
| from filer.models import File | |
| print 'PUBLIC\N' | |
| for f in File.objects.filter(is_public=True): | |
| sys.stdout.write(u'moving %s to public storage... ' % f.id) |
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
| import time | |
| from statistics.tasks import test | |
| for i in xrange(9999999): | |
| test.delay('test - %s' % i) | |
| time.sleep(2) | |
| i+=1 | |
| print i |
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
| libsrpos_plugin-0.2$ ./configure | |
| checking for a BSD-compatible install... /usr/bin/install -c | |
| checking whether build environment is sane... yes | |
| checking for a thread-safe mkdir -p... /bin/mkdir -p | |
| checking for gawk... gawk | |
| checking whether make sets $(MAKE)... yes | |
| checking build system type... i686-pc-linux-gnu | |
| checking host system type... i686-pc-linux-gnu | |
| checking how to print strings... printf |
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 YOUR_API_KEY = '' | |
| var dateUpdated = ""; | |
| function changeTitle() { | |
| var favi = jQuery('[rel="shortcut icon"]'); | |
| var titleDate = jQuery('p.author a').last().attr('title'); | |
| var reDate = /(\d+)\/(\d+)\/(\d+)/; | |
| //Swap year and day, convert to Date obj | |
| titleDate = (titleDate).replace(reDate, "$3/$2/$1"); |
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
| // locate and parse all relative time links on the page | |
| var reDate = /(\d+)\/(\d+)\/(\d+)/; | |
| jQuery('a[title]').map(function(){ | |
| var a = jQuery(this); | |
| if ((a.text() && a.text().length===0) || !a.attr('title').match(reDate) ){return 0} | |
| var d = new Date(a.attr('title').replace(reDate, "$3/$2/$1")); | |
| return 'make_relative('+d+')'; | |
| }) |
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
| if(typeof jQuery !== 'undefined'){ | |
| jQuery(function($) { | |
| var dateUpdated = ""; | |
| var reDate = /(\d+)\/(\d+)\/(\d+)/; | |
| var reIssues = /issues\/\d+/; | |
| var titleDate = $('p.author a').last().attr('title'); | |
| var style= 'position: fixed;bottom: 0px;margin-bottom: 0px;width: 100%;padding: 12px 0px 13px 30px;background-position-y: 12px;'; | |
| var warning = '<div class="flash warning" style="'+style+'">This issue has been updated since you last saw it. <a href="javascript:location.reload(true);">Refresh now</a></div>'; |
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 django.contrib import admin | |
| from django.db.models.loading import get_models | |
| # BaseAdmin does things like default list_display to all fields | |
| from core.admin import BaseAdmin | |
| import models as legacy_models | |
| for mod in get_models(legacy_models): | |
| if mod not in admin.site._registry: |
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
| # colours are from http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
| # in $WORKON_HOME/postactivate | |
| PS1="(`basename $VIRTUAL_ENV`)$BASE_PS1" | |
| # in $WORKON_HOME/postdeactivate | |
| PS1=$BASE_PS1 | |
| # in startup eg ~/.bashrc |
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
| $ GET http://xyz.com/14015/forxxx | |
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <meta charset="UTF-8"> | |
| <title>Just a moment...</title> | |
| <link rel="stylesheet" media="screen" href="/cdn-cgi/styles/js-challenge/error.css" type="text/css"> | |
| </head> | |
| <body> |
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
| graph binarySplitCountChange { | |
| "1:ch(3,List(1, 2, 3))" -- "2:ch(2,List(1, 2, 3))"; | |
| "1:ch(3,List(1, 2, 3))" -- "2:ch(3,List(2, 3))"; | |
| "2:ch(2,List(1, 2, 3))" -- "3:ch(1,List(1, 2, 3))"; | |
| "2:ch(2,List(1, 2, 3))" -- "3:ch(2,List(2, 3))"; | |
| "3:ch(1,List(1, 2, 3))" -- "4:ch(0,List(1, 2, 3))"; | |
| "3:ch(1,List(1, 2, 3))" -- "4:ch(1,List(2, 3))"; | |
| "4:ch(1,List(2, 3))" -- "5:ch(-1,List(2, 3))"; | |
| "4:ch(1,List(2, 3))" -- "5:ch(1,List(3))"; | |
| "5:ch(1,List(3))" -- "6:ch(-2,List(3))"; |