Skip to content

Instantly share code, notes, and snippets.

View carimatics's full-sized avatar

carimatics carimatics

View GitHub Profile
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;
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
@carimatics
carimatics / init_array.c
Last active November 1, 2016 01:24
Initializing Arrays in C language
/* 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}
@carimatics
carimatics / init.el
Last active June 7, 2016 04:56
pbcopy & pbpaste for Emacs
;;; 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))))