Skip to content

Instantly share code, notes, and snippets.

@johansigfrids
johansigfrids / extract.js
Last active July 29, 2017 21:38
Extract Trans messages from provided tsx file.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const ts = require("typescript");
function extract(fileName) {
const messages = new Map();
const file = fs_1.readFileSync(fileName);
const sourceFile = ts.createSourceFile(fileName, file.toString(), ts.ScriptTarget.ES2015, true);
parseNode(sourceFile);
function parseNode(node) {
@johansigfrids
johansigfrids / predfunc.jl
Created May 9, 2014 15:19
A macro that turns a linear model (LmMod, produced by lm() in GLM.jl) into a function which takes a separate argument for each variable in the model.
macro predfunc(name, model)
emod = eval(model)
typeof(emod) == LmMod || error("Error: Wrong model type.")
coefs = coef(emod)
if typeof(emod.ff.rhs) == Symbol
xes = [:intercept, emod.ff.rhs]
elseif typeof(emod.ff.rhs) == Expr
xes = emod.ff.rhs.args
xes[1] = :intercept
else
@johansigfrids
johansigfrids / mods.csv
Last active January 3, 2016 16:58
My Skyrim mods
mod_id mod_installed_name mod_version file_installed_name
4955 101BUGs HighResolution 4.1.0 83Willows 101BUGs V4_1 HighResolution-4955-4-1.7z
1037 26 Moon Size Tweeks 3.0.0 26 moon size tweeks-1037-3.rar
4929 A Quality World Map 8.0.0 0
225 Accingite Vos - Shields HQ Retextures 1.0.0 HQ Shields-225-1.rar
5312 Acquisitive Soul Gems 2.5.4 Acquisitive Soul Gems-5312-2-5-4.zip
18855 AIMP - Antz in my Pantz - Interactive Edition f2.03 AIMP - Antz in my Pantz-18855-v2-03.rar
16887 Altar Descriptions 1.0.0 BLESSINGS - Altar Descriptions-16887-V1.7z
24909 aMidianBorn Book of Silence - Armors 1.9.0 aMidianBorn book of silence_ARMORS-24909-1-9.7z
24909 aMidianBorn Book of Silence - Creatures 1.9.0 aMidianBorn book of silence_Creatures-24909-1-9.7z
@johansigfrids
johansigfrids / Term Project.ipynb
Last active December 30, 2015 20:38
My Term Project for Global Warming MOOC
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.