Skip to content

Instantly share code, notes, and snippets.

View Quantisan's full-sized avatar

Paul Lam Quantisan

View GitHub Profile
@Quantisan
Quantisan / 2010_PhysRevLett_Pulsating Tandem Microbubble for Localized and Directional Single-Cell Membrane Poration.tei.xml
Created September 6, 2023 00:54
2010_PhysRevLett_Pulsating Tandem Microbubble for Localized and Directional Single-Cell Membrane Poration
<?xml version="1.0" encoding="UTF-8"?><TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title level="a" type="main">Pulsating Tandem Microbubble for Localized and Directional Single-Cell Membrane Poration</title>
<funder ref="#_ZHHKCkE #_34xNgJX #_9GAuwET #_CgHRkTC">
<orgName type="full">National Institutes of Health</orgName>
<orgName type="abbreviated">NIH</orgName>
<idno type="DOI" subtype="crossref">10.13039/100000002</idno>
</funder>
@Quantisan
Quantisan / stepwise2.clj
Last active May 10, 2023 21:55
stepwise_v2 interface doodle
;; defining a Step Functions state machine
(def pizza-making-state-machine
(sfn/->> request
(sfn/parallel (make-dough)
(make-sauce)
(sfn/map {:iterate-over :ingredients} prepare-ingredients))
(put-ingredients-on-dough)
(bake)
(sfn/wait 2 :minutes)
@Quantisan
Quantisan / wunderground.R
Created February 12, 2012 11:43
a weather station data scrapper
# Scrapes wunderground weather record
#
# Based on http://casoilresource.lawr.ucdavis.edu/drupal/node/991
#
# Usage:
# fetch.temperature('ILONDONL8', '2012-01-01', '2012-01-30')
#
fetch.temperature <- function(station, start.date, end.date) {
date.range <- seq.Date(from=as.Date(start.date), to=as.Date(end.date), by='1 day')
@Quantisan
Quantisan / LM_demo.py
Created April 11, 2023 22:03
Motiva show and tell: problem solving with language models
# pip install torch transformers
from transformers import pipeline
generate = pipeline(model="declare-lab/flan-alpaca-xl")
prompt = "Write an email about an alpaca that likes flan"
generate(prompt, max_length=128, do_sample=True)
@Quantisan
Quantisan / burt_api.py
Last active February 10, 2022 20:57
Burt API endpoints
# Motiva Burt is served over a Restful API with POST, PUT, GET, and DELETE endpoints as such:
# POST /api/experiment/ request body expectation
# campaignStart model that is expected for request body when creating a campaign
campaignStart = api.model(
"CampaignStart",
{
# Datetime string defining the current time
"now": fields.String(required=True),
# List of treatment ids
(require '[stepwise.core :as stepwise])
(stepwise/ensure-state-machine
:make-pizza
{:start-at :make-dough
:states
{:make-dough {:type :task
:resource :make-pizza/make-dough
:next :make-sauce}
'use strict';
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
@Quantisan
Quantisan / run_algo.sh
Created September 10, 2018 00:07
AlgoVPN Docker: Deploying with scripted Ansible in a Docker container
# I had trouble provisioning AlgoVPN to EC2 with the included Docker image. The stdin
# isn't reading my AWS credentials correctly. So I'm running the ansible
# playbook directly to bypass entering the secrets. This is a record of my
# shell commands to get it provisioning an AlgoVPN server.
# First follow the instruction at https://github.com/trailofbits/algo/blob/master/docs/Docker.md
# to setup your config.cfg
# On the host machine, inside the algo repository folder, build the Docker image from source.
@Quantisan
Quantisan / RiskManager.java
Created June 18, 2012 21:31
JForex risk manager 1.0
/*
RiskManager.java
version 1.0
Copyright 2010 Quantisan.com
*/
package jforex;
import java.math.*;
@Quantisan
Quantisan / corr_demo.clj
Created June 26, 2011 00:49
first try using Incanter to analyse stocks data
(ns inc-sandbox.corr-demo
(:require [clojure.set :as set])
(:use (incanter core stats charts io))
(:require [clj-time.core :as time])
(:use (clj-time [format :only (formatter formatters parse)]
[coerce :only (to-long)])))
(defn sym-to-dataset
"returns a dataset read from a local CSV in './data/' given a Yahoo Finance symbol name"
[yf-symbol]