- 1password
- bitbar
- Caffiene
- Dash
- f.lux
- Handbrake
- Hemmingway App
- Homebrew
- ImageOptim
- iStat Menus
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 | |
""" | |
Download audio files from youtube links in a reddit thread. | |
Works a treat on /r/music/ | |
Usage: | |
./TUNE.py <url> | |
Requirements: youtube-dl, beautifulsoup4, python>=3.5 |
TIL from reading an early Jan post on the Django mailing list. Turns out that PyPI is making a whole bunch of data available on Google BigQuery.
In a subsequent post, Alex Gaynor gave us a query that extracts Python versions used to download a package on PyPI in the previous two weeks:
SELECT
REGEXP_EXTRACT(details.python, r"^([^\.]+\.[^\.]+\.[^\.]+)") as python_version,
COUNT(*) as download_count,
FROM
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 python | |
from urllib import urlopen | |
content = urlopen('http://markets.brntn.me').read().decode() | |
clinton = float(content.split('Clinton:<span class="text-right">')[-1].split('%')[0]) | |
trump = float(content.split('Trump:<span class="text-right">')[-1].split('%')[0]) | |
updated = content.split('Updated: ')[-1].split('\n')[0] |
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
{% load static %}<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>{% block title %}base.html via @sesh{% endblock %}</title> | |
<!-- Favicons in 32x32 and 16x16 --> |
- Why shouldn't i use mysql? / mongo?
- Should I use jinja, I read it's faster?
- Should I use sqlalchemy, I read it's superior?
- How do i make this thing happen in parallel/not wait for xxx to finish?
- Why does django ask for a default? (But my table has no data in it wtf django!?!)
- FunkyBob | I think, perhaps, it's time I wrote a blog post on "why does a migration adding a field need a default?"
- Why do I need to commit my migrations? Why can't I just run makemigrations on the server?
- migrations are source, makemigrations is a helper which takes you part way
- i've seen people accidentally lose their migrations on production… oops now what?
This file has been truncated, but you can view the full file.
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
{ | |
"sheets": { | |
"rawData": [ | |
{ | |
"date": "17/03/1996", | |
"pollster": "Newspoll", | |
"sample": "1000", | |
"LNP2PP": "59.81964336", | |
"ALP2PP": "40.18035664" | |
}, |
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
""" | |
An example for MelbDjango 2.8 by Brenton C. | |
This demonstrates both the most minimal possible Django implementation: | |
https://github.com/rnevius/minimal-django | |
And an exploit of the security issue fixed with Django 1.9.3: | |
https://www.djangoproject.com/weblog/2016/mar/01/security-releases/ | |
To run locally simple install Django < 1.9.3 (or Django < 1.8.10) in a virtualenv and run: |
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 random | |
def easypass(length=2, joiner='-'): | |
with open('wordlist.txt') as f: | |
words = f.readlines() | |
return joiner.join([random.choice(words).strip() for x in range(length)]) | |
if __name__ == '__main__': |
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.conf.urls import include, url | |
from django.contrib import admin | |
ADMIN_URLS = [ | |
'wp-admin/', # wordpress | |
'admin.php', | |
'login.php', | |
'phpmyadmin/', | |
'admin/login.php', |