Skip to content

Instantly share code, notes, and snippets.

James Waples jamwaffles

View GitHub Profile
use panic_semihosting as _;
use rtfm::app;
use stm32f1xx_hal::{
device, gpio,
gpio::{gpioc::PC13, Edge, ExtiPin, Output, PushPull, State},
//! Interface factory
//! This is the easiest way to create a driver instance. You can set various parameters of the
//! driver and give it an interface to use. The builder will return a
//! [`mode::RawMode`](../mode/raw/struct.RawMode.html) object which you should coerce to a richer
//! display mode, like [mode::Graphics](../mode/graphics/struct.GraphicsMode.html) for drawing
//! primitives and text.
//! # Examples
View esp8266_0v25_fixed.js
/* Copyright (c) 2015 Gordon Williams, Pur3 Ltd. Modified by James Waples 2018 */
Library for interfacing to the EspressIF ESP8266. Uses the 'NetworkJS'
library to provide a JS endpoint for HTTP.
For EspressIF ESP8266 firmware 0.25
var at;
var socks = [];
View CodeSchoolEspruino1.js
SPI1.setup({ baud:3200000, mosi: A7 });
var brightness = 0;
var delta = 1;
var maxBrightness = 250;
var numLeds = 12;
var data = new Uint8ClampedArray(numLeds * 3);
function sendFrame(data) {
jamwaffles /
Created Aug 13, 2015
Rust "class" definition
struct Sprite {
image_data: SomeBinaryType,
width: i16,
height: i16
impl Sprite {
pub fn new(filename: str) -> Sprite {
// TOOD: Load image into a Piston/OpenGL texture
View gist:c66a727287ef01ef10f5
var s3 = require('gulp-s3');
var gzip = require('gulp-gzip')
gulp.task('s3-gzip', function() {
var assetsConf = {
secret: "sTuPiDLongS3CretKey",
region: 'eu-west-1',
bucket: 'bucketName'
View fuckYouJquery.js
Backbone.$ = function(el) {
return {
on: function(eventName, handler) {
el.addEventListener(eventName, handler)
off: function() {
console.error("`off` isn't implemented. If you need to use this, implement it or you'll get memory leaks")
jamwaffles /
Last active May 27, 2020
Graphical merge tool for resolving Git merge conflicts

Diff screenshot


  1. Download DiffMerge from here. It's not the prettiest merge tool but it works.

  2. Install it as usual

  3. Open up a console and run the following commands:

     git config --global merge.tool diffmerge
     git config --global mergetool.diffmerge.cmd 'diffmerge --merge --result="$MERGED" "$LOCAL" "$(if test -f "$BASE"; then echo "$BASE"; else echo "$LOCAL"; fi)" "$REMOTE"'
jamwaffles / gist:4376dcda7644846543db
Last active Aug 29, 2015
tm-react-accordion howto
View gist:4376dcda7644846543db
var React = require('react')
var Accordion = require('tm-react-accordion').Accordion
var Item = require('tm-react-accordion').Item
var AccordionHeader = require('tm-react-accordion').Header
var AccordionContent = require('tm-react-accordion').Content
<Accordion className="custom-accordion-class">
<Item open={true} className="custom-item-class">
View ImgurAPI.php
namespace Model;
use RedBean_Facade as R;
class ImgurAPI extends \Pliers\Model {
protected $user;
protected $session;
public function __construct() {
You can’t perform that action at this time.