Skip to content

Instantly share code, notes, and snippets.

View nakajima's full-sized avatar
💭
you can have statuses now?

Pat Nakajima nakajima

💭
you can have statuses now?
View GitHub Profile
@groue
groue / ObservableState.swift
Last active June 18, 2025 05:44
WithBindable
// Copyright (C) 2025 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
@ironlungx
ironlungx / nvim-pio.md
Last active September 13, 2025 09:43
PlatformIO with Neovim

Caution

I've moved this gist over to a template repository here. Everything here is unmaintained...

Extensions

Following are the extensions required for neovim:

@oNaiPs
oNaiPs / lxc_create_github_actions_runner.sh
Last active October 29, 2025 12:58
Create LXC container as self-hosted github actions runner
#!/usr/bin/env bash
set -e
GITHUB_RUNNER_URL="https://github.com/actions/runner/releases/download/v2.311.0/actions-runner-linux-x64-2.311.0.tar.gz"
TEMPL_URL="http://download.proxmox.com/images/system/ubuntu-23.04-standard_23.04-1_amd64.tar.zst"
PCTSIZE="20G"
if [ -z "$GITHUB_TOKEN" ]; then
read -p "Enter github token: " GITHUB_TOKEN
@jiaaro
jiaaro / main.lua
Created August 14, 2023 21:49
Magic Musicbox v 1.2
--[[
Feature Ideas
- different cycle lengths per instrument
- Setting: "Crank to play", "very slow", "slow", "medium", "fast"
- Setting: set key, scale
- Key: C, C#, etc
- Scale: Major, Minor, Dorian
- change instrument for each track
- 3 drum samples, plus pentatonic scale
- randomize notes
@stecman
stecman / _readme.md
Last active October 5, 2025 09:30
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@dragonjet
dragonjet / 1-server.md
Last active July 31, 2021 21:01
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@martinklepsch
martinklepsch / README.md
Last active February 28, 2022 04:34
A very minimal Emacs configuration to get started with Emacs & Evil-mode

A Starting Point for using Emacs & Evil-mode

(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)

If you just want to play around with Emacs & Evil mode do the following:

  1. mkdir ~/.emacs.d/
  2. copy init.el into ~/.emacs.d/
  3. Download Emacs from http://emacsformacosx.com
@cutemachine
cutemachine / gradient_view.rb
Created May 10, 2012 14:58
GradientView with RubyMotion
class GradientView < UIView
def initWithFrame(frame)
if super
rgb = CGColorSpaceCreateDeviceRGB()
ptr = Pointer.new(:float, 8)
ptr[0] = 1.0
ptr[1] = 0.0
ptr[2] = 0.0
ptr[3] = 1.0
ptr[4] = 0.0
@rkh
rkh / chat.rb
Created December 14, 2011 12:55
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do