Skip to content

Instantly share code, notes, and snippets.

View jonahbron's full-sized avatar

Jonah Bron jonahbron

View GitHub Profile
@jonahbron
jonahbron / install.sh
Last active October 31, 2020 16:30
Install AVR Rust and Compile Blink
git clone git@github.com:avr-rust/rust.git avr-rust
cd avr-rust
git checkout avr-support # 8405b30 at time of writing
cp config.toml.example config.toml
# Manually uncomment experimental-targets setting in config.toml
./x.py build
rustup toolchain link avr $(realpath $(find build -name 'stage2'))
cd ../../
@jonahbron
jonahbron / error
Created April 6, 2020 16:47
could not compile core
$ cargo +avr xbuild --target avr-unknown-unknown --verbose
WARNING: There is no root package to read the cargo-xbuild config from.
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "/home/jonah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.enQPopALFvIP/Cargo.toml" "--target" "avr-unknown-unknown" "-v" "--" "-Z" "force-unstable-if-unmarked"
Updating crates.io index
Downloaded compiler_builtins v0.1.26
Downloaded 1 crate (134.9 KB) in 0.78s
Compiling core v0.0.0 (/run/media/jonah/data/Projects/avr-rust/src/libcore)
Compiling compiler_builtins v0.1.26

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jonahbron
jonahbron / FirebaseListAdapter.java
Created November 28, 2016 15:50
GeofireListAdapter
import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
#!/bin/bash
URL="page to watch"
PATTERN="pattern in page to watch"
get_page() {
curl "$URL" 2> /dev/null | grep -C 3 "$PATTERN"
}
NEW=$(get_page)
<md-input-container>
<label>Select Menu</label>
<md-select aria-label="Select menu" ng-model="vm.model">
<md-option ng-value="item" ng-repeat="item in vm.options track by item.id" ng-bind="item.name" select-track-by="id" select-model="vm.model"></md-option>
</md-select>
</md-input-container>
@jonahbron
jonahbron / serve
Created July 15, 2014 01:16
Single file server
serve_file=$1
ip_addr=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo "$ip_addr:8000"
while true ; do nc -l 8000 < "$serve_file" ; done
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
@jonahbron
jonahbron / rrgrep.sh
Created January 30, 2014 17:22
Shorten the command to search through rake routes
# Create a new, empty file if it does not exist. Creates parent directories if necessary.
#
# author Jonah Dahlquist
# license CC0
rrgrep() {
if hash zeus 2>/dev/null; then
zeus rake routes | grep $@
else
rake routes | grep $@
@jonahbron
jonahbron / punch.sh
Created December 18, 2013 00:27
Create a new, empty file if it does not exist. Creates parent directories if necessary.
# Create a new, empty file if it does not exist. Creates parent directories if necessary.
#
# author Jonah Dahlquist
# license CC0
punch() {
mkdir -p $(dirname $1)
touch $1
}