<([a-z][a-z0-9]*)[^>]*?(/?)>
| token | explanation |
|---|---|
| < | match < at beginning of tags |
| ( | start capture group $1 - tag name |
| [a-z] | match a through z |
| # show a cyan `OK!`, or arg `1` message | |
| function show_info() | |
| { | |
| local msg="OK!" | |
| if [ ! -z "$1" ]; then | |
| msg="$1" | |
| fi | |
| echo -e "\033[0;36m${msg}\033[0m" | |
| } |
| # update all non-sublime package control packages (osx) | |
| function update_sublimetext_packages() | |
| { | |
| echo "" | |
| echo "==> Updating Sublime Text Packages" | |
| echo "" | |
| local cwd=$(pwd) | |
| local subl_pkgs_dir=~/Library/Application\ Support/Sublime\ Text\ 3/Packages | |
| local repo= |
| #!/usr/bin/env bash | |
| # generate data uri scheme for file | |
| function datauri() | |
| { | |
| local mimeType=$(file -b --mime-type "$1") | |
| if [[ $mimeType == text/* ]]; then | |
| mimeType="${mimeType};charset=utf-8" | |
| fi | |
| echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')" |
| #!/usr/bin/env python | |
| import os.path as filepath | |
| import sys | |
| from optparse import OptionParser | |
| def main(): | |
| parser = OptionParser( | |
| prog='rp', usage="%prog [path]\n\nReturn the canonical path of the specified filename\n\n [path]\tpath of file to check\n\n when *no args* are passed, the current working directory\n will be set as [path].") |
| #!/usr/bin/env python | |
| import re | |
| import urllib2 | |
| def fetch_data(): | |
| return str(urllib2.urlopen('http://time.is').read()) | |
| #!/usr/bin/env bash | |
| # | |
| # Sublime Text 2|3 Markdown Build System | |
| # | |
| # This Sublime Text 2|3 build system simply takes Markdown source as an | |
| # arg(1) and parses the HTML for previewing in a browser window. | |
| # | |
| # **Requirements** | |
| # | |
| # - Sublime Text 3 <http://www.sublimetext.com> |
| ----------------------------------------------------------------------------- | |
| General | |
| ----------------------------------------------------------------------------- | |
| Command palette: | |
| cmd + shift + p | |
| Go to method: | |
| cmd + r |
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import glob | |
| from mutagen.mp3 import MP3 | |
| from mutagen.easyid3 import EasyID3 | |
| # | |
| # MP3 playlist generator |
| Event::listen('illuminate.query', function($sql) | |
| { | |
| Log::info('Request URL: '.Request::url() .' Query: '.$sql); | |
| }); |