Skip to content

Instantly share code, notes, and snippets.

View EchoAbstract's full-sized avatar

Brian Wilson EchoAbstract

  • TrustCloud
  • Boston, MA
View GitHub Profile
@EchoAbstract
EchoAbstract / pictures.markdown
Created September 10, 2012 18:18 — forked from sent-hil/pictures.markdown
River (getriver.com): Keep a programming journal.

One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.

At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:

  • Todo
  • Question
  • Thought
  • Bug
  • Feature
@EchoAbstract
EchoAbstract / strwidth.c
Last active December 13, 2015 17:09
Simple utility to compute the *Display Width* of a UTF-8 string.
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
#include <assert.h>
// Tested with:
// Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
// Target: x86_64-apple-darwin12.2.0
@EchoAbstract
EchoAbstract / ioctl-term-info.c
Created February 17, 2013 02:09
This shows how to grab the rows and columns of your terminal using either the TIOCGSIZE or TIOCGWINSZ ioctls. NB: There's no error handling and no fallback case. Tested on Debian and OS-X.
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
struct term_info {
int rows;
int cols;
};
;; Connect using jabber-connect
;; My username from the HipChat configuration
;; from https://www.hipchat.com/account/xmpp
(setq jabber-account-list '(("10804_81219@chat.hipchat.com")))
;; To join HipChat rooms easily
(defvar hipchat-number "10804")
(defvar hipchat-nickname "Brian McKenna")
(defun hipchat-join (room)
/**
* This stylesheet will work pretty well with a regular Org Mode HTML export.
* However, you do have to turn off all of the defaults:
*
* (setq org-export-html-style-include-scripts nil
* org-export-html-style-include-default nil)
*
* and insert a call to the stylesheet:
*
* (setq org-export-html-style
@EchoAbstract
EchoAbstract / update-julia.sh
Created February 22, 2014 14:28
Keeping Julia up-to-date on an OS-X system when using the system provided BLAS. To run, put the file in the root of your julia directory and run whenever you want to update your local clone. I should modify this so it can be run as a cron or at job.
#!/bin/bash
git checkout -- Make.inc
git pull
sed 's/\(USE_SYSTEM_BLAS\)=0/\1=1/' < Make.inc > Make.inc.tmp
mv Make.inc.tmp Make.inc
gnumake || (gnumake clean && gnumake)
./julia
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageDisplayName</key>
@interface UIWindow (resize)
-(void)_adjustSizeClassesAndResizeWindowToFrame:(CGRect)frame;
@end
typedef enum _UICustomRes
{
UICustomResiPadTwoThirds,
UICustomResiPadHalf,
UICustomResiPadOneThird,
UICustomResiPhone47,
@EchoAbstract
EchoAbstract / gpgmutt.md
Created April 13, 2016 17:49 — forked from bnagy/gpgmutt.md
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@EchoAbstract
EchoAbstract / v8-versions.md
Created August 24, 2016 13:41 — forked from domenic/v8-versions.md
V8 versions for embedders

Embedders of V8 should generally use the head of the branch corresponding to the minor version of V8 that ships in Chrome.

Finding the minor version of V8 corresponding to the latest stable Chrome

To find out what version this is,

  1. Go to https://omahaproxy.appspot.com/
  2. Find the latest stable Chrome version in the table
  3. Enter it into the "Translate a Chrome verison to a V8 version" box below the table.
  4. Ignore the last two parts.