Skip to content

Instantly share code, notes, and snippets.

View jameslittle230's full-sized avatar

James Little jameslittle230

View GitHub Profile
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;

James Little's Programming Stream

Hi! Thanks for checking out my stream. I'm James Little.

On stream, I work on Stork Search, an open-source web search tool I wrote. It's written in Rust that compiles to WebAssembly. Feel free to ask questions or just say hi!

You can use the following commands in chat: !today, !stork, !desk, or !commands to see a list of all the commands.

All historical streams have been uploaded to Youtube, under this playlist.

fn temp_write_config(_args: &[String]) {
let config = Config {
input: InputConfig {
base_directory: ".".to_string(),
stemming: StemmingConfig{
enabled: true,
language: Algorithm::French
},
#!/usr/bin/env bash
PATH=${PATH}:/usr/local/bin/
for f in "$@"
do
myoutput=""
basename=$(basename "$f")
dirname=$(dirname "$f")
shrink="${dirname}/p_${basename}"
jlittle at moosehead in ~/honors/5-tf-nbl-clean-setup
$ qrsh -l gpuk20=1 run.sh
Warning: Permanently added '[moose55]:46863,[139.140.230.205]:46863' (ECDSA) to the list of known hosts.
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /mnt/local/jboss/jboss-5.1.0.GA
@jameslittle230
jameslittle230 / query.sql
Created November 2, 2018 04:11
Almost-done query
select
article.id,
date,
title,
excerpt,
body
from
article LEFT JOIN (
select id, article_id, body, max(timestamp) from articlebody
group by article_id
@jameslittle230
jameslittle230 / hell.js
Created May 8, 2018 12:12
Callback Hell
app.get('/loadUserData', function(req, res) {
var keys, chats, messages;
var u_id = req.query.user_id;
db.all(`SELECT * FROM keys WHERE user_id = ` + u_id + ` OR expired_at IS NULL`, function(err, data) {
if(err || !data) return res.status(404).send(err || "No data found for ID");
keys = data;
db.all(`SELECT * FROM messages WHERE recipient_id = ` + u_id, function(err, data) {
if(err || !data) return res.status(404).send(err || "No data found for ID");
@jameslittle230
jameslittle230 / bg_fs.essl
Last active May 5, 2018 14:17
Fragment Shader with Noise Issues
Shader.source[document.currentScript.src.split('js/shaders/')[1]] = `
precision highp float;
varying vec3 rayDir;
uniform vec3 eyePos;
uniform samplerCube envmapTexture;
uniform mat4 quadrics[32];
uniform vec4 brdfs[16];

I have three tables that store data like this:

chats

chat_id sqn_num name
1 5 My Cool Chat
2 3 Another Awesome Chat
3 9 A Third Rockin' Chat
@jameslittle230
jameslittle230 / R2Image.cpp
Last active April 17, 2018 10:00
HW10 Submission: Blended Transformed Images
std::vector<Feature> R2Image::
Harris(double sigma)
{
const R2Image self = *this;
R2Image *t1 = new R2Image(self); t1->SobelX(); t1->Square();
R2Image *t2 = new R2Image(self); t2->SobelY(); t2->Square();
R2Image *t3 = new R2Image(Width(), Height());
R2Image *t4 = new R2Image(Width(), Height());
// Set T3 to product of T1 and T2
for(int x=0; x<Width(); x++) {