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 / install-gh.sh
Created April 6, 2023 16:43
Installing gh on linux (need easy to download public script)
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
@EchoAbstract
EchoAbstract / pearcy.py
Created January 8, 2017 13:38 — forked from anonymous/pearcy.py
Compute and plot Pearcey integral
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as integrate
# Dimension of image in pixels
N = 256
# Number of samples to use for integration
M = 32
@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.
@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
@interface UIWindow (resize)
-(void)_adjustSizeClassesAndResizeWindowToFrame:(CGRect)frame;
@end
typedef enum _UICustomRes
{
UICustomResiPadTwoThirds,
UICustomResiPadHalf,
UICustomResiPadOneThird,
UICustomResiPhone47,
<?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>
@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
/**
* 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
;; Connect using jabber-connect
;; My username from the HipChat configuration
;; from https://www.hipchat.com/account/xmpp
(setq jabber-account-list '(("[email protected]")))
;; To join HipChat rooms easily
(defvar hipchat-number "10804")
(defvar hipchat-nickname "Brian McKenna")
(defun hipchat-join (room)
@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;
};