Skip to content

Instantly share code, notes, and snippets.

View hrishioa's full-sized avatar

Hrishi Olickel hrishioa

View GitHub Profile
formula = 'time ~ C(alerttone) + C(blind) + C(alerttone):C(blind)'
model = ols(formula, alltimingdfs).fit()
aov_table = statsmodels.stats.anova.anova_lm(model, typ=2)
print(aov_table)
sum_sq df F PR(>F)
C(alerttone) 2.705937e+08 1.0 2.113892 1.462746e-01
C(blind) 4.655261e+10 1.0 363.671469 1.340934e-69
C(alerttone):C(blind) 2.129870e+08 1.0 1.663866 1.973740e-01
Residual 1.308235e+11 1022.0 NaN NaN
@hrishioa
hrishioa / save.sh
Last active March 31, 2018 01:31
Create simple gist for quick save from command line. Needs username and password in plaintext
curl -X POST -d "{\"public\":true,\"files\":{\"${1}\":{\"content\":\"${2}\"}}}" -u username:password https://api.github.com/gists
gotcha
it's a good amount of work and you're tight on time anyway
but the pay is really pretty great
hmm fair
like 20k for a month or two's work
and that's just the first phase
christ
okay
yeah I know
so hence me thinking it was good news
VSCode
@hrishioa
hrishioa / run_nym_node.sh
Created September 18, 2020 17:57
Quick script to set up and run a nym node
## Creator: Hrishi
## At: Sep 19 2020
sudo apt-get update && sudo apt-get install -y --no-install-recommends bash ca-certificates pkg-config build-essential libssl-dev && \
sudo useradd -U -m -s /sbin/nologin nym && \
curl -s https://api.github.com/repos/nymtech/nym/releases/latest | grep "nym-mixnode_linux_x86_64" | cut -d : -f 2,3 | tr -d \" | wget -qi -; \
chmod +x nym-mixnode_linux_x86_64 && \
ipaddr=$(curl -sS v4.icanhazip.com) && \
./nym-mixnode_linux_x86_64 init --id $1 --layer 3 --location 'sg' --host 0.0.0.0 --announce-host $ipaddr && \
./nym-mixnode_linux_x86_64 run --id $1
@hrishioa
hrishioa / gnome-battery-bench-visualisation-tool.html
Created December 5, 2020 03:28
Simple visualisation tool for Gnome battery bench results, with an option to extrapolate data to find the total battery life.
<!DOCTYPE html>
<head>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/regression/2.0.1/regression.min.js"></script>
<meta charset="utf-8">
</head>
<div id="batteryPlot" style="width:1000px;height:500px;"></div>
const BootBot = require('bootbot');
const ngrok = require('ngrok');
const request = require('request');
const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const adapter = new FileSync('user_db.json');
const user_db = low(adapter);
user_db.defaults({users: {}, suggestions: []}).write();
@hrishioa
hrishioa / maptest.html
Created September 23, 2021 09:14
Code for testing large scale marker redraws in mapbox
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Display a map on a webpage</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v2.4.1/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.4.1/mapbox-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
/**
*
* Task: Implement typeahead, suggestions and command search for cats using https://cataas.com/#/.
*
* Subtask 1: Implement a search box for users to search for cats by a tag, using `/cat/:tag`. Results should show the picture of the cat
* and the description. Example search `angry` -> API call would be https://cataas.com/cat/angry -> Picture of angry cat
*
* Subtask 2: Implement typeahead and suggestions for past searches (can be extended to common words from https://www.wordsapi.com/)
*
* Subtask 3: Implement command search, where users can type in `{cat type} says Hello`, and the returned picture uses this to call `/cat/:tag/says/:text`.
@hrishioa
hrishioa / related-posts.ts
Created February 3, 2022 08:46
Simple Post Recommendation Engine for Blog Posts