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 smtplib | |
| import os | |
| import sys | |
| from email.MIMEMultipart import MIMEMultipart | |
| from email.MIMEBase import MIMEBase | |
| from email.MIMEText import MIMEText | |
| from email.Utils import COMMASPACE, formatdate | |
| from email import Encoders | |
| from random import randint |
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
| function nicereadme { | |
| TARGET_DOC=${1:-/tmp/doc.html} | |
| INFILE=${2:-README.md} | |
| curl -s -X POST --data-urlencode content@$INFILE http://documentup.com/compiled > $TARGET_DOC; | |
| echo "$INFILE is pretty at file://$TARGET_DOC"; | |
| } |
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
| while read line; | |
| do curl -Is $line | egrep "Location" | awk -F": " '{print $2}' >> urls-resolved.txt; | |
| done < urls-2.txt |
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
| <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
| <script> | |
| $(document).ready(function() { | |
| $('#add_more').click(function(e) { | |
| $('form:first fieldset:first').clone().appendTo($('form:first')); | |
| }); | |
| }); | |
| </script> | |
| <pre> |
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 python2 | |
| # http://www.voidspace.org.uk/python/articles/configobj.shtml | |
| from configobj import ConfigObj | |
| # http://stackoverflow.com/a/7703144 | |
| from lxml.etree import Element, SubElement, tostring | |
| def parse_file(f): | |
| cfg = ConfigObj(f, encoding='UTF-8') |
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 sage | |
| import pickle | |
| from math import * | |
| from pylab import * | |
| """ | |
| See: http://goo.gl/y2A78 for information | |
| and how this was put together/concepted |
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
| # Bash command in a loop: | |
| while true; do uptime >> /tmp/uptime.log; sleep 5; done | |
| # Use awk to strip it out and grab 1min figure | |
| awk -F\ '{print $9}' la.txt | tr "," " " > uptime_1min.csv | |
| # In pylab (via:) run: | |
| ipython --pyab | |
| d = numpy.genfromtext('uptime_1min.csv') | |
| plot(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
| #!/bin/bash | |
| # This isn't nice with spaces, but then why you cloning a repo to a folder | |
| # with spaces!? could use IFS: http://goo.gl/dEkQU | |
| f=`find . -maxdepth 2 -type d -name ".git" | sed 's/\/.git//'` | |
| a=$(echo $f | tr " " "\n") | |
| for folder in $a; | |
| do | |
| cd $folder; |
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 bash | |
| bases=( "href" "src" "action" ) | |
| for base in ${bases[@]} | |
| do | |
| ack --ignore-dir "fleheaders" -l "$base=\"/" | xargs -n1 --replace sed -i "s/$base=\"\//$base=\"{{ url_base }}\//g" {} | grep url_base; | |
| done; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>name</key> | |
| <string>Monokai</string> | |
| <key>settings</key> | |
| <array> | |
| <dict> | |
| <key>settings</key> |