Skip to content

Instantly share code, notes, and snippets.

@deargle
deargle / GedcomToOrgChart
Last active December 15, 2015 04:38
I used DallinQ's GedcomToJson GitHub tool to convert a GEDCOM export of my PAF file to Json, then I used this script to display it with Google's OrgChart Visualization tool.
<html>
<head>
<!-- I used DallinQ's GedcomToJson GitHub tool to convert a GEDCOM export of my PAF file to Json, then I used this script to display it with Google's OrgChart Visualization tool. -->
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
<script type='text/javascript' src='famTree.js'></script><!-- this references the JSON output of my GEDCOM file. I edited the file and called the entire json "var famTree". -->
<script type='text/javascript'>
var rowData = [];
google.load('visualization', '1', {packages:['orgchart']});
@deargle
deargle / _psiturk_ssl.conf.md
Last active August 27, 2017 02:19 — forked from yosemitebandit/yupyupnope.conf
psiturk example ssl config: nginx config file for flask app (behind gunicorn) with ssl. See https://github.com/NYUCCL/psiTurk/pull/226

psiturk example ssl config: nginx config file for flask app (behind gunicorn) with ssl. See NYUCCL/psiTurk#226

@deargle
deargle / .vimrc
Created July 26, 2016 19:45
My .vimrc
set showcmd
set showmatch
set ignorecase
set incsearch
set autowrite
set tabstop=4
set expandtab
set title
set cindent
@deargle
deargle / _island.byu.edu-conf.md
Last active August 21, 2020 22:21
island.byu.edu configs and scripts

how to start from scratch

Deprecated: see https://github.com/deargle/island-vNext instead


  • set up the nginx-proxy docker-compose. pull down nginx.tmpl.
    • This will give auto letsencrypt
  • git clone discourse into /home/deargle/island, drop in the two container config files below. Build them using the discourse launcher
  • git clone the discourse-cas repo, up that.
@deargle
deargle / psiturk_batcher.sh
Last active November 10, 2019 03:10
batch create hits using psiturk
#!/bin/bash
set -e
#set -x
set -o nounset # aka set -u
# WHAT IS THIS
# -------------
# This will use the `psiturk -e` functionality to post batches of hits to mturk, with each hit
# having no more than 9 assignments so that requesters don't get hammered by the extra 20% commission (yeesh).
#
@deargle
deargle / client.conf
Last active February 16, 2024 20:14
OpenVPN server.conf and client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
from sqlalchemy import create_engine, MetaData, Table, text
import json
import pandas as pd
from boto.mturk.connection import MTurkConnection
import random
import sys
from psiturk.models import Participant
from psiturk.db import db_session, init_db
from psiturk.amt_services import MTurkServices
from psiturk.psiturk_config import PsiturkConfig
@deargle
deargle / get-kaggle-scores.py
Created March 7, 2018 20:14
A script to pull kaggle scores for the titanic competition and select only the top three
'''
This script downloads the public leaderboard data for a competition,
filters down to just the highest-scoring submissions for each
team with "Eargle" in the name, and saves the top-three scores
to a .csv in the current directory called `top-three <date-timestamp>.csv`
If you want to see the highest submission for _each_ team, just comment out
line 40 (put a `#` before it).
To run this, get python if you don't already have it, and also `pip` if you don't already have it,
@deargle
deargle / tokenize.py
Last active April 22, 2021 12:32
Example of TfidfVectorizer with custom tokenizer that does basic stemming
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 16:30:42 2018
@author: deargle
"""
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk.stem.porter import PorterStemmer
import nltk
@deargle
deargle / docker-compose.yml
Created January 31, 2019 03:34
nginx-proxy docker compose config file
version: '3'
services:
nginx:
image: nginx:1.14.2
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes: