| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| """WSGI application file""" | |
| import os | |
| from django.core.wsgi import get_wsgi_application | |
| from barrel import cooper | |
| os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings') | |
| django_app = get_wsgi_application() |
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
| """Utility to send passwords to a list of addresses in a CSV file""" | |
| import os | |
| import sys | |
| import csv | |
| import string | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| from random import choice, randint, seed |
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
| #!/bin/bash | |
| target_hosts="dynhost.does-not-exist.com another-host.does-not-exist.com" | |
| if [ -f "/root/mysql-allow-hosts-current" ]; then | |
| mv /root/mysql-allow-hosts-current /root/mysql-allow-hosts-prev | |
| fi | |
| touch /root/mysql-allow-hosts-current |
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
| javascript:inputs=document.getElementsByTagName('input');for(i=0;i<inputs.length;i++){if(inputs[i].type&&inputs[i].type=='checkbox'){inputs[i].checked=true;}} |
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
| ioreg -lw0 | grep \"EDID\" | sed "/[^<]*</s///" | xxd -p -r | strings -6 |
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 urls | |
| def show_urls(urllist, depth=0): | |
| for entry in urllist: | |
| print "-" * depth, entry.regex.pattern | |
| if hasattr(entry, 'url_patterns'): | |
| show_urls(entry.url_patterns, depth + 1) | |
| show_urls(urls.urlpatterns) |
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
| curl -s http://checkip.dyndns.org/ 2>&1 | sed 's/.*\(<body>.*\s\(.*\)<\/body>\).*/\2/' |
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 os.path | |
| from deploy.utils.importing import import_object | |
| def _get_variation_path(path, variation): | |
| return os.path.join( | |
| os.path.dirname(path), | |
| variation.lower().replace(' ', '-'), | |
| os.path.basename(path) | |
| ) |
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 urllib | |
| import urllib2 | |
| import json | |
| def geocode(address): | |
| """Quick & Dirty utility to get geocoded lat/lng from Google Geocode API""" | |
| address = urllib.quote(address.replace(' ', '+').encode('utf-8')) | |
| query = 'http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false' % address | |
| raw_json = None |
OlderNewer