Skip to content

Instantly share code, notes, and snippets.

View richrd's full-sized avatar

Richard Lewis richrd

  • Aibidia Oy
  • Helsinki, Finland
View GitHub Profile
@gmsanchez
gmsanchez / nxtlinux.txt
Created August 20, 2017 02:31
Lego NXT Mindstorms configuration on Linux
This file can be found in http://bricxcc.sourceforge.net/nbc/doc/nxtlinux.txt
For ubuntu and other recent linux distributions here is a new procedure that I recommend using to configure your Linux box for use with the NXT:
1. Add a legonxt group. From a terminal prompt type
sudo addgroup legonxt
2. Add your account to the legonxt group. From a terminal prompt type
@sebble
sebble / stars.sh
Last active August 25, 2025 09:04
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo

op-1 keys

tape mode

cmd desc
shift + help set date - time
shift + tempo detune notes - cents
shift + tape erase tape
shift + synth undo edits and revert to the preset
@wiledal
wiledal / template-literals-3-for-loops.js
Last active January 1, 2025 06:18
Template Literals example: For loops
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `
-28.5 dbfs
-25.5 dbfs
-22.5 dbfs
-19.5 dbfs
-16.5 dbfs
-13.5 dbfs
-10.5 dbfs
constant gain
-76.5 dbfs
-73.5 dbfs
Showing LDR /Users/kaonashi/git/op1-fw-packer/op1_076/te-boot.ldr ...
LDR block 1: [off:0x00000000] [header(0x10): 0650b5ad 0000a0ff 00000000 1c0d0000] [data(0x00000000)]
LDR block 2: [off:0x00000010] [header(0x10): 060038ad 004080ff ac000000 00000000] [data(0x000000ac)]
LDR block 3: [off:0x000000cc] [header(0x10): 0600d0ad 0000a0ff 2c080000 00000000] [data(0x0000082c)]
LDR block 4: [off:0x00000908] [header(0x10): 0600f5ad 0000a1ff 04040000 00000000] [data(0x00000404)]
LDR block 5: [off:0x00000d1c] [header(0x10): 0608fcad 0000a0ff 00000000 00000000] [data(0x00000000)]
LDR block 6: [off:0x00000d2c] [header(0x10): 065087ad 0000a0ff 00000000 80a00300] [data(0x00000000)]
LDR block 7: [off:0x00000d3c] [header(0x10): 060016ad 04000000 f04b0200 00000000] [data(0x00024bf0)]
LDR block 8: [off:0x0002593c] [header(0x10): 06015bad 00000001 0000f000 00000000] [data(0x00f00000)]
LDR block 9: [off:0x0002594c] [header(0x10): 060063ad 0000f001 38010000 00000000] [data(0x00000138)]
const template = data =>
`<p>
Use the <strong>${ data.power }</strong>, ${ data.name }!
</p>`
document.getElementById( 'target' ).innerHTML = template( {name: "Luke", power: "force"} )
@cvuorinen
cvuorinen / deploy.py
Last active February 3, 2018 20:40
Deploy Button on Olimex A20-OLinuXino-LIME with Jenkins build status and capistrano deploy. More information here: http://cvuorinen.net/2015/10/building-a-deploy-button/
#!/usr/bin/env python
import os
import time
from pyA20Lime.gpio import gpio
from pyA20Lime.gpio import port
from autojenkins import Jenkins
### configration parameters
@lsfxz
lsfxz / PKGBUILD
Last active January 23, 2018 01:36
PKGBUILD for suplemon
pkgname=suplemon-python-git
pkgver=528.3933555
pkgrel=1
pkgdesc="A modern, powerful and intuitive console text editor with multi cursor support."
arch=('any')
url="https://github.com/richrd/suplemon"
license=('MIT')
depends=('python')
makedepends=('python-setuptools' 'git')
optdepends=('flake8: For showing linting for Python files.'
@twolfson
twolfson / main.py
Last active November 13, 2018 04:57
Proof of concept to see how testing with ncurses works
# https://docs.python.org/2/howto/curses.html
# Load in our dependencies
import curses
import sys
# Notes for future self:
# KeyboardInterrupt is generated by using an actual terminal
# Ctrl+C is interpretted into a signal
# We can actually type Ctrl+C via the `echo` command or by using `curses'` raw mode
# http://linux.die.net/man/3/cbreak