Skip to content

Instantly share code, notes, and snippets.

View abalter's full-sized avatar

Ariel Balter abalter

  • Center For Health Systems Effectiveness, OHSU
  • Portland, OR
View GitHub Profile
@abalter
abalter / 0_reuse_code.js
Created February 20, 2016 18:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@abalter
abalter / labkey-windows-install.md
Last active September 25, 2020 17:33
A record of my personal attempt to install a LabKe(()y development environment in Windows 10 (March 8-9, 2016). Also working on converting the LabKey Excel checklist to markdown.

Callbacks

Callbacks are functions mostly used to handle the result of an action such as a query or a UI event, such as a click. And, especially in JQuery (worth learning--makes a lot of things super simple). They are especially important in situations that run asynchronously such as the two above examples.

Asynchronous operations

Asynchronous means that the interpreter does not wait for the action specified in a block

@abalter
abalter / a-simple-condor-intro.md
Last active September 29, 2016 05:08
condor-simple-examples

Introduction to Creating and Running Programs

hello.py

Run a simple python program. Don't worry if you don't know python. But you should be familiar with the concept of running a script in some language like bash or R etc.

See the code below.

  1. Run it
var a = `
hello there from test
`;
@abalter
abalter / rstudiodump.txt
Created August 19, 2016 19:30
Rstudio dump Ubuntu Xenail 16.04
QXcbConnection: Failed to initialize XRandr
Qt: XKEYBOARD extension not present on the X server.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unsupported screen format: depth: 16, red_mask: 3f, blue_mask: f800
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::setRenderHint: Painter must be active to set rendering hints
@abalter
abalter / 0-pandoc-markdown-linebreaks.md
Last active December 1, 2016 17:57
pandoc-markdown-linebreaks

I'm starting out with a file like this:

This is a 
sentence broken
over many lines
without double spaces at 
the ends of line. It
renders as a single 
paragraph.
@abalter
abalter / argparse1.md
Last active May 30, 2023 11:51
Python Aargparsing Examples

http://stackoverflow.com/a/30493366/188963

Other answers do mention that argparse is the way to go for new Python, but do not give usage examples. For completeness, here is a short summary of how to use argparse:

1) Initialize

import argparse

# Instantiate the parser

parser = argparse.ArgumentParser(description='Optional app description')

@abalter
abalter / py_R_bash.ipynb
Created April 18, 2017 21:36
Python, R, and bash all together in a Jupyter notebook.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<body>
<div color="blue" border="10" font-size="48px">hello</div>
<div style="color:red; border:10px; font-size:48px">hello</div>
</body>
</html>