Skip to content

Instantly share code, notes, and snippets.

View lemonkey's full-sized avatar
🏠
Working from home

Ari Braginsky lemonkey

🏠
Working from home
View GitHub Profile
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
A paper company which handles trees, logs, and paper. Uses a custom logging component.
*/
import os.log
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@unforgiven512
unforgiven512 / irrecord_key_and_button_namespace.md
Last active February 6, 2023 16:40
Organized list of LIRC button names

lirc -- keys & buttons namespace

The list was obtained using the following command...

# irrecord --list-namespace

...and was obtained from [this website][1].

@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active February 2, 2025 11:21
React Native Bridging Cheatsheet
@SkaTeMasTer
SkaTeMasTer / log-rotate
Created February 13, 2017 08:51
Log rotate is important to keep the SD cards on Raspberry pi from corruption, disable any logging when possible (after debugging)
Logfile RoATING file operations using UNIX logrotate utility.
=============================================
+ Rotate the log file when file size reaches a specific size
+ Continue to write the log information to the newly created file after rotating the old log file
+ Compress the rotated log files
+ Specify compression option for the rotated log files
+ Rotate the old log files with the date in the filename
+ Execute custom shell scripts immediately after log rotation
+ Remove older rotated log files
@dschep
dschep / raspbian-python3.6.rst
Last active November 21, 2024 15:10 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@bennuttall
bennuttall / remotegpio.md
Last active January 13, 2025 23:19
Set up a Pi and host PC for remote GPIO access using gpiozero

Remote GPIO

GPIO Zero allows you to create objects representing GPIO devices. As well as running it on a Raspberry Pi, you can also install GPIO Zero on a PC and create objects referencing GPIO pins on a Pi over the network.

To do this, you'll need to do a few things to get set up:

  1. Enable Remote GPIO on the Pi in the Raspberry Pi Configuration Tool.

  2. Run the pigpio daemon on the Pi:

@jonathanconway
jonathanconway / midi
Created November 29, 2016 05:23
Plays a midi file. Bash script that calls FluidSynth with SoftSynth sound-bank on a midi file, to play it through the system audio.
#!/bin/bash
exec fluidsynth -i /Library/Audio/Sounds/Banks/GeneralUser\ GS\ v1.47.sf2 $1
@0xced
0xced / NSProgressHandlers.m
Last active October 5, 2016 18:52
Demonstrates how NSProgress handlers being invoked on any queue (as documented) might be problematic
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
@autoreleasepool
{
NSProgress *progress = [[NSProgress alloc] initWithParent:nil userInfo:nil];
progress.cancellationHandler = ^{
NSLog(@"cancel");
};
@hollance
hollance / neural.c
Last active April 21, 2023 17:13
Playing with BNNS on macOS 10.12. The "hello world" of neural networks.
/*
The "hello world" of neural networks: a simple 3-layer feed-forward
network that implements an XOR logic gate.
The first layer is the input layer. It has two neurons a and b, which
are the two inputs to the XOR gate.
The middle layer is the hidden layer. This has two neurons h1, h2 that
will learn what it means to be an XOR gate.