Skip to content

Instantly share code, notes, and snippets.

View fauxneticien's full-sized avatar

Nay San fauxneticien

View GitHub Profile
@fauxneticien
fauxneticien / flora_all.txt
Created November 28, 2017 04:54
Convert nested Warlpiri flora terms to HTML output
\me jakanypa (N): (H)
\dm flora: watiya: \edm
\lat Petalostylis cassioides \elat
\me jakutakuta (N): (La,Y)
\dm flora: miyi: \edm
\lat Cassytha filiformis \elat
\me janjinki (N): (Y)
\dm flora: watiya: \edm
\lat Acacia inaequilatera \elat
\me janjinngi (N): (Y)
@fauxneticien
fauxneticien / ejs_table_example.ejs
Created November 24, 2017 02:33
Make an HTML or CSV output in EJS
<%
my_table = [
{ "me" : "voiture", "eng": "car" },
{ "me": "rouge", "eng": "red" }
]
%>
<table>
<% my_table.map(row => {%>
<tr>
@fauxneticien
fauxneticien / _pipeline.sh
Created November 22, 2017 05:22
Dalabon hello world parsing and templating (Nearley, Moo, EJS)
# You may need to run
npm link moo
npm link nearley
# npm link [package-name-of-a-global-install]
# for the first you run things to get the packages linked to
# the directory in which you are running the scripts
# Compile nearley grammar to javascript code
nearleyc grammar.ne > grammar.js
@fauxneticien
fauxneticien / app.R
Last active November 9, 2017 06:44
Warlpiri reversalizer
library(shiny)
library(dplyr)
library(stringr)
library(zoo)
library(purrr)
library(tidyr)
options(shiny.maxRequestSize=30*1024^2)
reversalize <- function(wrl_txt_path) {
@fauxneticien
fauxneticien / readme.md
Last active October 29, 2017 23:40
Set up RStudio on Nectar for teaching R
@fauxneticien
fauxneticien / 1-austlangs-map.R
Created October 25, 2017 12:10
Visualise number of speakers of Australian languages in R
library(tidyverse)
library(leaflet)
lang_dialects <- read_csv(
# CSV file of languages with region, latitude and longitude
file = "https://git.io/vFeOj"
)
abs_2016 <- read_csv(
# CSBV file of ABS 2016 census data with language names and number of speakers
@fauxneticien
fauxneticien / mhsF0_df.R
Last active October 25, 2017 05:43
Read in pitch tracks from .wav files as an R data frame
# This is a tidyverse-friendly wrapper function for wrassp::mhsF0
#
# Usage:
#
# dir(path = ".", pattern = "*.wav", full.names = TRUE) %>% mhsF0_df
# dir(path = ".", pattern = "*.wav", full.names = TRUE) %>% mhsF0_df(beginTime = 1, gender = "f")
#
# For list of arguments to wrassp::mhsF0, see https://www.rdocumentation.org/packages/wrassp/versions/0.1.4/topics/mhsF0
mhsF0_df <- function(fileList, ...) {
@fauxneticien
fauxneticien / ecuder.js
Created October 19, 2017 05:35
Ecuder — the opposite of reduce
/*
// Helper to split an initial object into a nested array
// by Mark Ellison <https://github.com/tyrannomark> mostly!
ecuder([x => x.split(" ")])("one two")
ecuder([x => x.split(" "), x => x.split("")])("one two")
ecuder([x => x.split(/\.\s?/), x => x.split(" "), x => x.split("")])("sentence one. sentence two")
*/
function ecuder(funcs_array, initial_obj) {
@fauxneticien
fauxneticien / add-50-rusers.R
Last active October 25, 2017 12:45
Generate shell script to add 50 users into rocker/verse
# Generates a script ~/init_users.sh, which when run
# adds 50 users who can log into the Docker image running rocker/verse
# https://hub.docker.com/r/rocker/verse/
library(purrr)
library(stringr)
install.packages("glue")
library(glue)
@fauxneticien
fauxneticien / .block
Created September 18, 2017 04:46 — forked from mbostock/.block
Equirectangular (Plate Carrée)
license: gpl-3.0
height: 480