Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@aculich
aculich / ghstars.sh
Last active October 2, 2021 06:17
List all my currently starred github repos
#!/bin/bash
# List all my currently starred github repos
# username supplied on command line or default to configured github username
ghuser=${1:-$(git config --get github.user)}
if [ -z "$ghuser" ]; then echo -e "Usage: $0 github_username\n\nOptionally: set your github user in ~/.gitconfig"; exit 1; fi
# iterate through all the pages of starred repos
for i in `seq 1 $n`; do curl -s "https://api.github.com/users/$ghuser/starred?access_token=$HOMEBREW_GITHUB_API_TOKEN&per_page=100&page=$i" >> /tmp/starred_${ghuser}-$i.json ; done
@aculich
aculich / curl.md
Created November 27, 2017 02:02 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@aculich
aculich / rdm-filesummary
Last active November 28, 2017 18:06
A useful RDM (Research Data Management) utility for examining the distribution of file sizes
#!/bin/bash
# Based on: https://superuser.com/a/1100340/58245
DIR=${1:-.}
# One-liner version of what's expanded below:
#
# find $DIR -type f -print0 | xargs -0 ls -l | awk '{ n=int(log($5)/log(2)); if (n<10) { n=10; } size[n]++ } END { for (i in size) printf("%d %d\n", 2^i, size[i]) }' | sort -n | awk 'function human(x) { x[1]/=1024; if (x[1]>=1024) { x[2]++; human(x) } } { a[1]=$1; a[2]=0; human(a); printf("%3d%s: %6d\n", a[1],substr("kMGTEPYZ",a[2]+1,1),$2) }'
@aculich
aculich / cc-mailing-list-queries.sql
Last active December 12, 2017 20:21
Campus Champions mailing list queries
-- top 10 active discussions of all time
select
COUNT(*) AS threadlength, REPLACE(REPLACE(REPLACE(LOWER(subject), 're: ', ''), '[campuschampions] ', ''), X'0A', '') AS cleansubject
FROM messages
GROUP BY cleansubject
ORDER BY threadlength
DESC LIMIT 10;
-- top 10 active discussions in 2017
SELECT
@aculich
aculich / dlab-sage-jhub-notes
Last active September 11, 2018 03:26
bacon sage notes
# Before you begin
gcloud container clusters get-credentials sagecampus --zone europe-west1-d
# If you ever change config.yaml in hub-deployment
helm upgrade jhub jupyterhub/jupyterhub --version=v0.6 -f config.yaml
# Individual users plus hub and proxy which are always there
kubectl get pods --namespace sagecampus
# Get nodes
@aculich
aculich / remove-all-dock-icons
Last active August 4, 2018 21:58
Remove all icons from OS X dock
#!/bin/bash
git clone https://github.com/jcarm010/osx-dock-remover
cd osx-dock-remover
for i in `sudo -u me defaults read com.apple.dock persistent-apps | grep file-label | cut -c 28- | cut -d\; -f1`; do python dock-icon-remove.py -r $i; done
@aculich
aculich / GPG and git on macOS.md
Created September 6, 2018 00:58 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@aculich
aculich / spacemacs-cheatsheet.md
Created September 12, 2018 22:22 — forked from 526avijitgupta/spacemacs-cheatsheet.md
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@aculich
aculich / install-globus.sh
Last active September 18, 2018 15:38
quick globus install
#!/usr/bin/env bash
# See official docs: https://docs.globus.org/how-to/globus-connect-personal-linux/#globus-connect-personal-cli
GLOBUS_VERSION=2.3.6
## install Globus Personal Connect
VERSION=$GLOBUS_VERSION
wget --directory-prefix=/usr/local https://s3.amazonaws.com/connect.globusonline.org/linux/stable/globusconnectpersonal-$VERSION.tgz
(cd /usr/local && tar zxvf globusconnectpersonal-$VERSION.tgz)
@aculich
aculich / CapsLockCtrlEscape.ahk
Created September 23, 2018 06:53 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}