Skip to content

Instantly share code, notes, and snippets.

View jnsdbr's full-sized avatar
👀
Whats up?

Jens jnsdbr

👀
Whats up?
View GitHub Profile
@smorad
smorad / setup.sh
Last active April 28, 2024 14:34
Cambridge eduroam on Ubuntu Server 20.04 (on a raspberry pi)
# First setup Ubuntu 20.04 on your SD card if you haven't already
# I assume by this point you have the Ubuntu SD card still in your laptop/pc
# We need to copy the cat tool to the SD card
# Download the installer here: https://cat.eduroam.org/
# Add the cat installer to the pi SD card; run these commands on your laptop
mkdir /mnt/rpi
# Find the block device for your SD card. Be careful here -- you can mess up your OS if you choose the wrong device!
lsblk # You should see something like
# mmcblk0 259:0 0 15.4G 0 disk
@Intyre
Intyre / Wahoo_Elemnt.md
Last active June 25, 2024 14:44
Wahoo Elemnt - Tips, tricks and custom images
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@sam016
sam016 / AllGattCharacteristics.java
Last active July 5, 2024 15:52
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@mahenzon
mahenzon / deploy_flask_lighttpd.py
Last active June 29, 2024 23:22
Flask (Python 3) + flup + Lighttpd project deploy
import os
import stat
import argparse
template_fcgi = '''#!/usr/bin/env python3
from flup.server.fcgi import WSGIServer
from %s import app
class ScriptNameStripper(object):
@atduskgreg
atduskgreg / PWindow.pde
Last active November 15, 2023 13:29
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
@indiesquidge
indiesquidge / homebrew.md
Last active July 14, 2024 21:10
How to and Best of Homebrew

Homebrew

How To

Homebrew is a package management system for OS X. You can read more about it here, or simply run

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

to install it.

@nmyers
nmyers / acf-map.php
Last active February 19, 2020 06:56
ACF Static google map with link #acf #wp
<?php
$location = get_field('location');
if( !empty($location) ):
?>
<a href="http://www.google.com/maps/preview#!q=<?=urlencode( $location['address'] )?>">
<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=15&format=png&sensor=false&size=397x297&maptype=roadmap&visual_refresh=true&style=visibility:off&style=feature:road|element:geometry|visibility:simplified&style=feature:landscape|element:geometry|visibility:simplified&style=element:labels|visibility:on&markers=color:red|<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>"/>
</a>
<?php endif; ?>
@kriegsman
kriegsman / PaletteCrossfade.ino
Last active March 2, 2024 01:37
How to cross-fade between color palettes using nblendPaletteTowardPalette
#include <FastLED.h>
#define LED_PIN 3
#define NUM_LEDS 30
#define BRIGHTNESS 96
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
anonymous
anonymous / gist:9326801
Created March 3, 2014 15:00
DM422C Tuning

Software

Protune for DM series works for the DM422C stepper drive. If it doesn't work, you might want to try ProTuner_All_Previous. You must select the application made for DM422C (not DM422). Also works in Linux under Wine (even better than on Windows XP). The USB to serial adaptor must supply true RS232 logic levels. Using Prolific chipsets seems to be tricky. FTDI chipsets worked like a charm.

Wine needs a symlink to the serial port:

ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1 (Linux)