Skip to content

Instantly share code, notes, and snippets.

View mgrider's full-sized avatar

Martin Grider mgrider

View GitHub Profile
@mgrider
mgrider / Color+GFXP.swift
Last active March 25, 2024 14:35
A GFXP helper class for use with PlaydateKit
import PlaydateKit
/// A collection of [`PlaydateKit`](https://github.com/finnvoor/PlaydateKit/) `Graphics.Color` "patterns" based on [the GFXP library](https://github.com/ivansergeev/gfxp).
///
/// Use these in your `PlaydateKit` project by adding this file, and doing something like:
/// ```swift
/// Graphics.fillRect(.init(x: 10, y: 10, width: 100, height: 100), color: GFXP.lightGray)
/// ```
///
/// Alternatively, create your own patterns with [the GFXP editor](https://dev.crankit.app/tools/gfxp/)
@mgrider
mgrider / CustomTests.swift
Created December 4, 2023 16:59
parent XCTestCase class for storing snapshot tests in a separate repository
import XCTest
import SnapshotTesting
/// A parent class for test cases in this project. This doesn't contain any actual tests itself, but rather
/// helper functions you can use to ease testing of common cases.
///
/// See `assertCustomSnapshots` for a usage example, and the default sizes that will be testsed.
class CustomTests: XCTestCase {
/// Whether or not to test snapshots. Change this to run unit tests without performing snapshot testing.
@mgrider
mgrider / vim-swift-setup.sh
Last active March 22, 2024 01:55 — forked from jlehikoinen/setup.sh
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim
# More about Vim packages: http://vimcasts.org/episodes/packages/
echo "--- creating ~/.vim/pack/bundle/start dir.."
mkdir -p ~/.vim/pack/bundle/start
echo "--- Cloning Apple's Swift repo.."
@mgrider
mgrider / prepare_icons.sh
Last active June 27, 2023 22:02 — forked from alvinthen/prepare_icons.sh
Make all app icons with imagemagick, iOS and Android
#!/bin/sh
base=$1
if [ -z $base ]
then
echo No argument given
else
##
## iOS files
convert "$base" -resize 20x20! "Icon-20.png"
@mgrider
mgrider / CameraBehavior.cs
Created April 30, 2019 16:46
Quick and dirty rotate camera around something...
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AbstractPuzzle
{
public class CameraManager : MonoBehaviour
{
public GameObject cameraObject;
public GameObject centerObject;

Keybase proof

I hereby claim:

  • I am mgrider on github.
  • I am livingtech (https://keybase.io/livingtech) on keybase.
  • I have a public key whose fingerprint is 3F4D 27C3 5D2D 355A F57F 33ED 8677 3767 33E1 30EE

To claim this, I am signing this object:

// This #include statement was automatically added by the Spark IDE.
#include "neopixel/neopixel.h"
#include <math.h>
//set up the pin that controls the LEDs, the type of LEDs (WS2812B) and the number of LEDs in the cube (8*8*8=512)
#define PIXEL_PIN D0
#define PIXEL_COUNT 512
#define PIXEL_TYPE WS2812B
#define SIDE 8