Skip to content

Instantly share code, notes, and snippets.

View jmagnuson's full-sized avatar

Jon Magnuson jmagnuson

  • Minneapolis, MN
View GitHub Profile
@jmagnuson
jmagnuson / cc_hello_mips32.sh
Created August 12, 2021 04:39
Steps to compile rust hello-world for mips32r1 (uclibc)
#!/bin/bash
if [ -z "$STAGING_DIR" ]; then
echo "STAGING_DIR not defined.. exiting"
exit 1
fi
#FOUND_PATH=`echo $PATH | grep -i uclibc`
if [ -z `echo $PATH | grep -i uclibc` ]; then

Keybase proof

I hereby claim:

  • I am jmagnuson on github.
  • I am jmagnuson (https://keybase.io/jmagnuson) on keybase.
  • I have a public key ASALqluluQA1hefa6IhuTHoLROO9iiEA_GNBamPLEOlppQo

To claim this, I am signing this object:

@jmagnuson
jmagnuson / main.rs
Last active March 1, 2017 06:00
parseEq
#![feature(fnbox)]
extern crate itertools;
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
use std::collections::HashMap;
use std::boxed::FnBox;
@jmagnuson
jmagnuson / day1-1.c
Last active February 14, 2016 05:03
Advent of Code 2015
#include <stdio.h>
#include <stdlib.h>
/**
* '(' = 40
* ')' = 41
*
* '(' -> +1 floor
* ')' -> -1 floor
*
#include "application.h"
/*
* Serial - link between Photon and USB
* Serial1 - link between Photon and Nano
*/
/**************************
* Config defines *
@jmagnuson
jmagnuson / max_val.c
Created April 14, 2014 14:56
Finds maximum/minimum value between two signed integers without the use of conditionals
#include <stdlib.h>
#include <stdio.h>
#define INT_SHIFT ( (sizeof(int) - 1) * 4 )
int max_val( int a, int b )
{
int *val_ptrs[2] = {&a, &b};
int difference_bit = ( ( *val_ptrs[0] - *val_ptrs[1] ) &