Skip to content

Instantly share code, notes, and snippets.

import time
from twilio.rest import Client
import requests
from dateutil import parser
# Create client
account_sid = 'xxx' # Grab from Twilio
auth_token = 'xxx' # Grab from Twilio
client = Client(account_sid, auth_token)
@joshuajnoble
joshuajnoble / partially_linear.r
Last active April 24, 2023 18:39
Causality Reading : Double ML
transform_data <- function(c, i){
randnum = runif(1)
if (round(i/3) == i/3){
return(cos(c + 1))
}
else if (round(i/4) == i/4){
return(sin(c + 1))
}
else if (round(i/2) == i/2){
return(c^2)
classroom treated prev_grade post_grade
1 0 91 92
4 0 87 89
1 0 101 102
3 1 77 85
4 1 84 95
1 1 81 80
3 1 70 79
3 0 77 82
1 1 101 102
---
title: "causal_trees_demo"
output: html_document
date: '2022-11-09'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
userID The ID of our user
redesignedA Whether this user received the redesigned Task A or not
redesignedB Whether this user received the redesigned Task B or not
redesignedC Whether this user received the redesigned Task C or not
startedOnWebsite Whether this user started on the website (rather than the phone system)
transferredToAPS Whether this user started on the website but transferred over to the phone system
transferredToRep Whether this user uesd the phone system but transferred to a representative
timeToCompleteA How long did it take them to do Task A on the website?
usedHelpInA Did they use the help functionality during Task A
transferredDuringA Did they transfer to the phone service during Task A?
#include <bluefruit.h>
#define WAKE_LOW_PIN PIN_A0
#define WAKE_HIGH_PIN PIN_A1
#define SLEEPING_DELAY 10000 // sleep after 30 seconds of blinking
void gotoSleep(unsigned long time)
{
// shutdown when time reaches SLEEPING_DELAY ms
@joshuajnoble
joshuajnoble / d3_scatterplot.js
Created January 14, 2021 20:11
A basic scatterplot in d3
function scatterPlot({
chart, /* this needs to be an SVG element */
width,
height,
data,
xfield,
yfield,
xdomain, /* min/max x values */
ydomain, /* min/max y values */
xpadding,
zookeeper_1 | [2020-07-08 17:56:34,373] INFO Server environment:java.home=/usr/lib/jvm/zulu-8-amd64/jre (org.apache.zookeeper.server.ZooKeeperServer)
zookeeper_1 | [2020-07-08 17:56:34,374] INFO Server environment:java.class.path=/usr/bin/../share/java/kafka/httpmime-4.5.11.jar:/usr/bin/../share/java/kafka/jakarta.activation-api-1.2.1.jar:/usr/bin/../share/java/kafka/maven-artifact-3.6.3.jar:/usr/bin/../share/java/kafka/netty-transport-4.1.45.Final.jar:/usr/bin/../share/java/kafka/hk2-locator-2.5.0.jar:/usr/bin/../share/java/kafka/javax.servlet-api-3.1.0.jar:/usr/bin/../share/java/kafka/scala-collection-compat_2.12-2.1.3.jar:/usr/bin/../share/java/kafka/metrics-core-2.2.0.jar:/usr/bin/../share/java/kafka/paranamer-2.8.jar:/usr/bin/../share/java/kafka/kafka_2.12-5.5.0-ccs-scaladoc.jar:/usr/bin/../share/java/kafka/netty-resolver-4.1.45.Final.jar:/usr/bin/../share/java/kafka/kafka_2.12-5.5.0-ccs.jar:/usr/bin/../share/java/kafka/jetty-servlet-9.4.24.v20191120.jar:/usr/bin/../share/java/kafka/javassist-3.22.0-CR
@joshuajnoble
joshuajnoble / index.js
Last active March 3, 2017 10:19
P5 to Processing
/* this is your node server, put it somewhere public
then call
npm install websockets --save
then node index.js
*/
// before running this you must do:
// npm install
var express = require('express');
var app = express();
var serveIndex = require('serve-index');
var serveStatic = require('serve-static');
var http = require('http').Server(app);
var io = require('socket.io')(http);