Skip to content

Instantly share code, notes, and snippets.

View jmcgill's full-sized avatar

James McGill jmcgill

View GitHub Profile
@jmcgill
jmcgill / cnc_control.ino
Last active January 4, 2023 03:18
Code for Arduino based CNC Controller
#include <Keyboard.h>
#include <EEPROM.h>
#include <Encoder.h>
int CENTER = 0;
int UP = 1;
int DOWN = 2;
int LEFT = 3;
int RIGHT = 4;
@jmcgill
jmcgill / actions.py
Last active July 6, 2020 14:48
RASA / Duckling Form example
from typing import Dict, Text, Any, List, Union, Optional
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
class BudgetForm(FormAction):
def name(self) -> Text:
import requests
import re
url = "http://www.zsxsoft.com/php-useragent/test-my-useragent.php"
response = requests.get(url)
content = response.text
print re.search('UserAgent: .*', content).group()
@jmcgill
jmcgill / descriptors.c
Last active March 24, 2018 19:54
A minimal sample of a generic batch mode USB device using LUFA.
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
@jmcgill
jmcgill / utils.c
Created November 30, 2011 22:49 — forked from anonymous/Robogals.c
Lego NXC Utilities
// Handy functions for Lego Mindstorms, written in NXC.
// See the end of this file for a sample program that uses these functions.
// Author: James McGill, 2011
//
// To compile:
// /nbc test.nxc -O=test.rxe -v=127
//
// To download to the Lego brick:
// /nxtcom -U test.rxe
@jmcgill
jmcgill / gist:1396667
Created November 27, 2011 00:55
SFML and Box2D Demo
#include <Box2D/Box2D.h>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <stdio.h>
#include <cstring>
#include "DebugDraw.h"
#define kBodies 5
b2Body* CreateBody(b2World& world, int32 index) {