Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
def strip_emojis(text) | |
text = text.force_encoding('utf-8').encode | |
clean = "" | |
# symbols & pics | |
regex = /[\u{1f300}-\u{1f5ff}]/ | |
clean = text.gsub(regex, "") | |
# enclosed chars | |
regex = /[\u{2500}-\u{2BEF}]/ |
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# Grab google web fonts and embed them as base64 data URIs | |
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/> | |
require 'base64' | |
if ARGV.length > 0 | |
input = ARGV | |
elsif STDIN.stat.size > 0 | |
input = STDIN.read.strip.split(/\n+/) |
Yosemite DNS cache flush:
sudo discoveryutil mdnsflushcache
sudo discoveryutil udnsflushcaches
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>{%title%}</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style type="text/css"> |
#!/usr/bin/python | |
# ReadingListCatcher | |
# - A script for exporting Safari Reading List items to Markdown and Pinboard | |
# Brett Terpstra 2015 | |
# Uses code from <https://gist.github.com/robmathers/5995026> | |
# Requires Python pinboard lib for Pinboard.in import: | |
# `easy_install pinboard` or `pip install pinboard` | |
import plistlib | |
from shutil import copy | |
import subprocess |
__sizeup_build_query () { | |
local bool="and" | |
local query="" | |
for t in $@; do | |
query="$query -$bool -iname \"*.$t\"" | |
bool="or" | |
done | |
echo -n "$query" | |
} |
""" | |
Automate loading of F-Script Anywhere into any app. | |
By Daniel Jalkut - @danielpunkass - http://indiestack.com/ | |
Revision 0.2 by Marco Fabbri - @mrfabbri - mrfabbri@gmail.com | |
To set up: | |
0. Make sure you have FScript.framework installed in /Library/Frameworks (http://www.fscript.org) | |
1. Copy this script to ~/.lldb/fsa.py | |
2. Add the following to your ~/.lldbinit file: |
{ | |
"shell_cmd": ["cat", "$file", "|", "/usr/bin/ruby", "/Users/ttscoff/scripts/update_workflow.rb"] | |
} |
@"(?:\\(|:\\s+)(?!http)([^\\s]+\\.(?:jpe?g|gif|png|svg|pdf))" | |
# matches local images: | |
# matches "(image.png)" | |
# matches "]: image.png" | |
# does not match remote images (http*) |