Skip to content

Instantly share code, notes, and snippets.

Lars Vilhuber larsvilhuber

Block or report user

Report or block larsvilhuber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@larsvilhuber
larsvilhuber / 00_setup.do
Last active Sep 10, 2018
Setup file for Stata
View 00_setup.do
/* 00_setup.do */
/* Suggested by Lars Vilhuber */
/* Create a reproducible Stata sequence by running this file as the first part of the program sequence */
/* Get it at https://gist.github.com/larsvilhuber/8ead0ba85119e4085e71ab3062760190 */
/* install any packages locally */
// Make a path local to the project
// Also see my related config.do at https://gist.github.com/larsvilhuber/6bcf4ff820285a1f1b9cfff2c81ca02b
local pwd "/c/path/to/project"
capture mkdir `pwd'/ado
@larsvilhuber
larsvilhuber / ced2ar.sh
Created Apr 17, 2018
Shell script to start CED2AR desktop app
View ced2ar.sh
#!/bin/bash
# now open a browser, after letting Tomcat spin up
echo "
============ CED2AR ===============
To exit CED2AR, hit CTRL-C in the Terminal.
Waiting 10s for Tomcat to start"
@larsvilhuber
larsvilhuber / gitcreate.sh
Created Mar 26, 2018 — forked from robwierzbowski/gitcreate.sh
A simple litte script. Create and push to a new github repo from the command line.
View gitcreate.sh
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@larsvilhuber
larsvilhuber / convert_bepress_metadata.py
Last active Feb 26, 2018
Script to convert CSV to OJS metadata format (approximately Bepress import from non-standard metadata)
View convert_bepress_metadata.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 17 11:40:28 2017
@author: vilhuber
"""
# Replaced by https://github.com/journalprivacyconfidentiality/jpc-migration/releases/tag/1.0
@larsvilhuber
larsvilhuber / etoggle.tex
Created Dec 15, 2017
Use of toggle in latex
View etoggle.tex
\usepackage{etoolbox}
\newtoggle{final}
\newtoggle{blind}
%\togglefalse{final}
\toggletrue{final}
%\toggletrue{blind}
\togglefalse{blind}
@larsvilhuber
larsvilhuber / add_datatoggle.sh
Last active May 28, 2019
Add a Data Toggle Tile to Samsung devices without root
View add_datatoggle.sh
#!/bin/bash
# Based on https://www.xda-developers.com/how-to-restore-mobile-data-quick-settings-tile-toggle-on-samsung-galaxy-devices/
# This will work with minor adjustments to your installation of the Android SDK or wherever you put adb.
# Should work on Linux and Mac, but only tested on Linux
PATH=../android-sdk-linux/platform-tools:$PATH
outfile=list.$(date +%F)
adb devices
echo "Do you see your device? [y|N]"
@larsvilhuber
larsvilhuber / gist:77eba9016504bedbede51dd6683aa573
Created Oct 26, 2017
OJS3 import with href submission file
View gist:77eba9016504bedbede51dd6683aa573
<?xml version="1.0"?>
<issue xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" published="1" current="1" access_status="1" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
<id type="internal" advice="ignore">1</id>
<issue_identification>
<volume>1</volume>
<number>10</number>
<year>2009</year>
<title locale="en_US">Old Issue</title>
</issue_identification>
<date_published>2009-01-01</date_published>
@larsvilhuber
larsvilhuber / jupyter.qsub
Created Nov 11, 2016
Qsub file to run a jupyter notebook instance
View jupyter.qsub
#!/bin/bash -l
#PBS -l walltime=01:00:00
#PBS -l ncpus=1
#PBS -N jupyter
source /etc/profile.d/modules.sh
module load python/anaconda
hostname
jupyter notebook
@larsvilhuber
larsvilhuber / mirror.repec.sh
Created Sep 30, 2016
Mirroring of Stata packages from Repec
View mirror.repec.sh
#!/bin/bash
SRCURL=http://fmwww.bc.edu/repec/bocode/
if [[ -z $1 ]]
then
cat << EOF
$0 start
mirror $SRCURL to this directory
@larsvilhuber
larsvilhuber / SR-test.tex
Created Sep 6, 2016
Code that seems to flumox StatRep package.
View SR-test.tex
\begin{Sascode}[store=mytest,program]
%macro main;
data one;
do j=1 to 10;
%do i = 1 %to 70;
var&i. = &i.;
%end;
output;
end;
run;
You can’t perform that action at this time.