Skip to content

Instantly share code, notes, and snippets.

View jdrew1303's full-sized avatar
probably drinking coffee

James Drew jdrew1303

probably drinking coffee
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdrew1303
jdrew1303 / message_basics.sh
Created August 16, 2019 20:12 — forked from kor01/message_basics.sh
[ros msg] ros message #ros
# show message definition
rosmsg show sensor_msgs/CameraInfo
# show message type
rostopic type rosout
# quick message definition view
rostopic type rosout | rosmsg show
# echo message live content
@jdrew1303
jdrew1303 / publish_video.py
Last active August 1, 2019 04:17 — forked from wngreene/publish_video.py
Publish a video as ROS messages.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Massachusetts Institute of Technology
"""Publish a video as ROS messages.
"""
import argparse
@jdrew1303
jdrew1303 / CSI-2-picamera.py
Created August 1, 2019 04:09 — forked from OndraZizka/CSI-2-picamera.py
OpenCV, Python, camera, Raspberry Pi
# sudo apt-get install python-picamera
import picamera
from time import sleep
camera = picamera.PiCamera()
camera.capture('image.jpg')
camera.start_preview()
camera.vflip = True
camera.hflip = True

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@jdrew1303
jdrew1303 / gcc compiler optimization for arm systems.md
Created July 17, 2019 00:05 — forked from fm4dd/gcc compiler optimization for arm systems.md
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@jdrew1303
jdrew1303 / index.js
Created June 27, 2019 23:46
bulk modifying github labels
[
{
"name": "Type: Help Needed",
"color": "5319e7"
},
{
"name": "Priority: Critical",
"color": "ff2222"
},
{
@jdrew1303
jdrew1303 / install_duckietown.sh
Created June 25, 2019 00:59
installing duckietown 2019
sudo apt-get update
# Set up basic development packages
sudo apt-get install -y python3.7 python3-pip git git-lfs curl wget
# Set up docker
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
@jdrew1303
jdrew1303 / demo.js
Last active June 8, 2019 01:43
Example Folktale Composed Validations (needs work)
const {Success, Failure} = require( 'folktale/validation');
const R = require('ramda');
const isRequired = (form, field) => !!form[field].trim()
? Success([])
: Failure(["This field is required"])
const isEmail = (form, field) => /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(form[field])
? Success([])
: Failure([`${form[field]} doesn't seem to be an email`])