Skip to content

Instantly share code, notes, and snippets.

@njm2112
njm2112 / SmartenQuotes.sh
Created December 24, 2016 17:17 — forked from benrothe/SmartenQuotes.sh
A TextExpander snippet to convert clipboard contents: "Straight" quotes to “curly”, double-hyphens to em-dashes and three periods to ellipses.
#!/usr/bin/env php
<?php
$str = `pbpaste`;
$str = preg_replace('/(^|[-\xe2\x80\x94\/(\[{"\s])\'/', "$1\xe2\x80\x98", $str);
$str = preg_replace('/\'/', "\xe2\x80\x99", $str);
$str = preg_replace('/(^|[-\xe2\x80\x94\/(\[{\xe2\x80\x98\s])"/', "$1\xe2\x80\x9c", $str);
$str = preg_replace('/"/', "\xe2\x80\x9d", $str);
$str = preg_replace('/--/', "\xe2\x80\x94", $str);
$str = preg_replace('/\.\.\./', "\xe2\x80\xa6", $str);
echo $str;
@njm2112
njm2112 / keybase.md
Last active July 18, 2017 01:45
Keybase proof

Keybase proof

I hereby claim:

  • I am njm2112 on github.
  • I am nm1 (https://keybase.io/nm1) on keybase.
  • I have a public key whose fingerprint is 4A2C F74B 4F96 CD20 FD86 23EB 6317 943E 74BE 68F4

To claim this, I am signing this object:

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
ctrl+b Move cursor back one character
ctrl+f Move cursor forward one character
@njm2112
njm2112 / markdown.md
Created August 13, 2016 04:19 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet. I used Bootstrap's Base CSS documentation as a reference.

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading