This file contains 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
use Time::Piece (); | |
use feature qw/say/; | |
my $tw = { created_at => 'Sat Aug 01 01:56:26 +0000 2010', }; | |
my $tp = Time::Piece->strptime( $tw->{created_at}, "%a %b %d %T %z %Y" ); | |
say $tp->datetime; |
This file contains 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
PATH=/usr/local/opt/openssl/bin:$PATH \ | |
LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH \ | |
CPATH=/usr/local/opt/openssl/include:$CPATH \ | |
LDFLAGS=-L/usr/local/opt/openssl/lib \ | |
CPPFLAGS=-I/usr/local/opt/openssl/include \ | |
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH \ | |
carton install |
This file contains 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
/* see also: https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html */ | |
// assign by index bracket | |
int nums[5] = { [2] = 10 }; //=> nums: { 0, 0, 10, 0, 0} | |
int nums[5] = { [2] = 10, [4] = 20} //=> nums: { 0, 0, 10, 0, 20} | |
// assign by range | |
int nums[5] = { [0 ... 4] = 0}; //=> nums: { 0, 0, 0, 0, 0} | |
int nums[5] = { [0 ... 2] = 1, 2, 3}; //=> nums: { 1, 1, 1, 2, 3} |
This file contains 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
;;; Share the clipboard between OS X and Emacs | |
(defun copy-from-osx () | |
(shell-command-to-string "pbpaste")) | |
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) |