To ignore whitespace when diffing in GitHub, simply append ?w=1
to the URL. e.g., compare
this page and this page.
set theUrl to do shell script "pbpaste | grep -o -E \"\\b(https?|ftp|file)://[-A-z0-9+&@#/%?=~_|.;]*[A-z0-9+&@#/%=~_|]\" | head -1" | |
if theUrl = "" then | |
set html to do shell script "osascript -e 'Β«class HTMLΒ» of (the clipboard as record)' | perl -ne 'print chr foreach unpack(\"C*\",pack(\"H*\",substr($_,11,-3)))'" | |
set theUrl to do shell script "echo " & quoted form of html & " | grep -o -E \"\\b(https?|ftp|file)://[-A-z0-9+&@#/%?=~_|.;]*[A-z0-9+&@#/%=~_|]\" | head -1" | |
end if | |
using terms from application "Safari" | |
tell application "Safari" | |
add reading list item theUrl as string | |
end tell |
% This code snippet in the preamble makes tables and figures the same type of float, so that they are placed in the same queue (and hence appear in the order of appearance). | |
\makeatletter | |
\let\ftype@table\ftype@figure | |
\makeatother |
#!/usr/bin/env python3.3 | |
# Convert LaTeX type dashes: - for hyphen, -- for en-dash, --- for | |
# em-dash to html: -, –, — in markdown. | |
# | |
# Usage: | |
# python dashify FILE_PATH | |
# ./dashify FILE_PATH | |
# | |
# One file allowed at a time. A backup file will be created each time |
#!/usr/bin/env python | |
# Take one argument--the doi, and convert it to bibtex using an API | |
# call to dx.doi.org. | |
from sys import argv | |
import os | |
if argv[0].find('doi') != -1: | |
# run as executable |
To use xargs
with custom script that takes in a fixed number of arguments, we need to use the replacement feature of xargs
. For instance, given a script that indends to take one argument, e.g.
$ cat awesome.sh
#!/bin/zsh
is_awesome=' is awesome!'
awesome_sentence=$1$is_awesome
echo $awesome_sentence
A naive xargs
call
Question: How does information get out of the black hole?
Proposed options:
It doesn't get out -- black hole doesn't evaporate fully, information is in remnants.
*Problem*: Pathological properties. Remnants of the Planck scale (where Hawking's black hole radiation calculations fail) enclose a huge amount of entropy.
Information never falls through the horizon ("brick wall").
-
(10/30/2016) I am not sure when and how this gist gained quite a few stars... But as stated in the v1.13 change log (from 06/16/2015): some content may be outdated, and I am not going to fix them. Moreover, having learned much myself, I do not necessarily agree with every point made in this document from 2.5 years ago. Therefore, please take views from this document with a grain of salt, and do further research as you see fit.
-
This document was initally written for a friend of mine, Jiawen Li, so it might reflect some personal tastes here and there. For instance, some discussions are geared towards Windows, though *nix is obviously superior. For another example, when I say "you seem to love Sublime Text a lot," I'm certainly not expecting most people to love Sublime (in fact I never used it for more than three minutes in a row).
-
This document is written in Markdown. The Markdown rendering engine on GitHub Gist is somewhat limited a
The iCanlendar standard: RFC 2445: Internet Calendaring and Scheduling Core Object Specification (iCalendar).
Validators:
iCalendar Validator
Another iCalendar Validator
β β ⌘
β ⌘
β the Command Key symbol
β₯ β ⌥
β ⌥
β the Option Key symbol
β§ β ⇧
β ⇧
β the Shift Key symbol
β β ⌃
β ⌃
β the Control Key symbol
β β ⎋
β ⎋
β the ESC Key symbol
βͺ β ⇪
β ⇪
β the Capslock symbol
β β ⏎
β ⏎
β the Return symbol
β« β ⌫
β ⌫
β the Delete / Backspace symbol
β₯ β ⇥
β ⇥
β the Tab Key symbol