An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| #!/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 |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| #!/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) }' |
| -- 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 |
| # 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 |
| #!/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 |
No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
gpg --list-secret-keys and look for sec, use the key ID for the next stepgit to use GPG -- replace the key with the one from gpg --list-secret-keysemacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
C-/C-?M-c
2. Upper Case : M-uM-l| #!/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) |
| g_LastCtrlKeyDownTime := 0 | |
| g_AbortSendEsc := false | |
| g_ControlRepeatDetected := false | |
| *CapsLock:: | |
| if (g_ControlRepeatDetected) | |
| { | |
| return | |
| } |