Skip to content

Instantly share code, notes, and snippets.

@austinjp
austinjp / papers_by_fos.py
Created November 19, 2020 18:13 — forked from jaklinger/papers_by_fos.py
Get papers from Open Academic Graph by FOS
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.sql import text as sql_text
from collections import defaultdict
with open('/Users/jklinger/Nesta-AWS/AWS-RDS-config/open-academic-graph.config') as f:
host, port, database, user, password = f.read().split(':')
database_uri = 'postgresql://{}:{}@{}/{}'.format(user, password, host, "microsoft_academic_graph")
con = create_engine(database_uri)
@austinjp
austinjp / signtext.js
Created September 24, 2020 14:34 — forked from Glamdring/signtext.js
WebCrypto API electronic signature
<html>
<head>
<script type="text/javascript">
function sign(input, password) {
// salt should be Uint8Array or ArrayBuffer
var saltBuffer = str2ab('e85c53e7f119d41fd7895cdc9d7bb9dd');
// don't use naive approaches for converting text, otherwise international
// characters won't have the correct byte sequences. Use TextEncoder when
// available or otherwise use relevant polyfills
@austinjp
austinjp / gitflow-breakdown.md
Created January 7, 2020 17:00 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@austinjp
austinjp / pandoc-newpage.pl
Last active September 3, 2018 17:33 — forked from bpj/pandoc-newpage.pl
Pandoc filter which converts LaTeX \newpage commands into appropriate pagebreak markup for other formats.
#!/usr/bin/env perl
# Pandoc filter which converts paragraps containing only the LaTeX
# `\newpage` or `\pagebreak` command into appropriate pagebreak markup
# for other formats.
#
# You will need perl version 5.10.1 or higher <https://www.perl.org/get.html>
# (Strawberry Perl recommended on Windows!)
# and a module installer <http://www.cpan.org/modules/INSTALL.html>
# and the Pandoc::Elements module version 0.33 or higher
@austinjp
austinjp / EdgarBuildNotes.txt
Created April 2, 2018 16:56 — forked from atiensivu/EdgarBuildNotes.txt
Dual boot Ubuntu 17.10 alpha on Chromebook 14 (EDGAR) 4GB model (CB3-431-C5FM)
# A roundabout way to get Ubuntu Artful alpha (17.10) on EDGAR (Acer Chromebook 14 4GB version - CB3-431-C5FM)
# Install missing 'legacy' BIOS piece to enable Ctrl-L on boot:
cd; curl -LOk https://mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh
# Install Galliumos (nightly - as of 09/09/2017)
# https://wiki.galliumos.org/Installing
cd; curl -LOk https://chrx.org/go && sh go -d galliumos -e desktop -r nightly -v
@austinjp
austinjp / migrate-from-github-to-bitbucket.sh
Last active March 26, 2018 11:54 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
set -euo pipefail
read -p "Github repo to clone: " gh
read -p "Bitbucket destination: " bb
read -p "Github username: " ghu
read -p "Bitbucket username: " bbu
git clone https://github.com/$ghu/$gh