Skip to content

Instantly share code, notes, and snippets.

View kshaa's full-sized avatar

Krišjānis Veinbahs kshaa

View GitHub Profile
@Measter
Measter / abstraction_adventures.md
Created September 8, 2020 16:04
My Adventures in MMIO Abstraction

My Adventures in MMIO Abstraction

Some years ago, I came across a simple Roguelike on Reddit called coreRL. It's very simplistic; levels are just a box with two walls, only one enemy type with basic AI, no health or character attributes, and the only goal is to see how far you can get before you die. Having nothing better to do, I thought it'd be a fun little project to write a port for an Arduino Nano. The only inputs needed are the four movement keys, and the display can just be a basic SSD1306-driven 128x64 OLED panel.

I could, of course, do this in C++. The language is a known quantity for the ATmega328P that powers the Arduino Nano. The toolchain is mature, as are the abstractions for interacting with the onboard peripherals. There are also libraries

@jonlabelle
jonlabelle / dotnetcheatsheet.md
Created July 23, 2018 19:50 — forked from nth-block/dotnetcheatsheet.md
Dotnet core Cheat Sheet
{ stdenv, fetchurl, dpkg, patchelf, libusb1 }:
stdenv.mkDerivation rec {
name = "adept-${version}";
version = "2.16.5";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://cloud.digilentinc.com/Software/Adept2+Runtime/${version}/digilent.adept.runtime_${version}-amd64.deb";
@joashp
joashp / PushNotifications.php
Last active February 19, 2025 06:09
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@ikenna
ikenna / print system and environment properties in sbt console
Last active February 29, 2024 15:00
SBT print system properties and env proprties
sbt> eval new scala.sys.SystemProperties().foreach(x => println(x))
sbt> eval scala.sys.env.foreach(x => println(x))
@ipedrazas
ipedrazas / knife cheat
Last active August 11, 2025 20:28
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@obstschale
obstschale / octave.md
Last active April 12, 2025 00:17
An Octave introduction cheat sheet.
@arturaz
arturaz / ADT.cs
Created September 22, 2013 09:55
Defining same ADT in C# and Scala
public abstract class Kind {
public class Global : Kind {}
public class World : Kind {
public readonly int world;
public World(int world) {
this.world = world;
}
}
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active November 29, 2025 18:38
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>