Skip to content

Instantly share code, notes, and snippets.

@dclamage
dclamage / fpuzzles-solution.user.js
Last active January 29, 2023 22:03
Allows setters to specify a solution to the puzzle, which is checked in solve mode when the final digit is entered.
// ==UserScript==
// @name Fpuzzles-Solution
// @namespace http://tampermonkey.net/
// @version 2.1
// @description Can input a solution to a puzzle, with a custom message for a correct solve.
// @author Rangsk, Charlie
// @match https://*.f-puzzles.com/*
// @match https://f-puzzles.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
@mikhailov-work
mikhailov-work / turbo_colormap.glsl
Last active February 19, 2024 22:18
Turbo Colormap Polynomial Approximation in GLSL
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
// Polynomial approximation in GLSL for the Turbo colormap
// Original LUT: https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f
// Authors:
// Colormap Design: Anton Mikhailov (mikhailov@google.com)
// GLSL Approximation: Ruofei Du (ruofei@google.com)
@radgeRayden
radgeRayden / main.sc
Last active May 20, 2019 18:18
sokol triangle example in scopes
include
(import sokol)
""""#define SOKOL_NO_ENTRY
#define SOKOL_IMPL
#define SOKOL_GLCORE33
#include "include/sokol/sokol_app.h"
#include "include/sokol/sokol_gfx.h"
include
(import C)
@aras-p
aras-p / package_builds_vs2017.cmd
Created April 9, 2019 19:36
Packaging up Visual Studio & Windows 10 SDK for in-repository usage
@echo off
@rem Packages up VS2017 toolchain into builds.7z archive
@set TOOLS_VERSION=14.13.26128
@cd "%~dp0"
@set VC_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\VC\
@if not exist "%VC_PATH%" goto error_no_vs
@if not exist "%VC_PATH%"Tools\MSVC\%TOOLS_VERSION% goto error_no_vs
@gcatlin
gcatlin / glfw-metal-example.m
Last active March 23, 2024 18:13
Minimal C GLFW Metal example
//
// cc glfw-metal-example.m `pkg-config --cflags --libs glfw3` -framework AppKit -framework Metal -framework QuartzCore
//
#define GLFW_INCLUDE_NONE
#define GLFW_EXPOSE_NATIVE_COCOA
#include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
@fzwo
fzwo / LegacyDocsets.md
Last active April 11, 2024 09:20
Download and view old Apple developer documentation

How to download and view legacy documentation from Apple (no need to sign in to your dev account)

  1. Download the docset index XML.
  2. Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
  3. Download the dmg. It's probably around a gigabyte or so.
  4. "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
    1. Find the largest file, named Payload, and extract it using The Unarchiver.
    2. This creates a new, even larger file, probably named Payload-1.
    3. Extract Payload-1 using The Unarchiver.
  5. After many minutes of extracting, we have our .docset file.
@vurtun
vurtun / gui.md
Last active October 4, 2023 15:44

Graphical User Interfaces

For the last few weeks I spend some time coding, writing and cleaning up my notes from almost a year since I published nuklear.

Basically this is a possible implementation for a graphical user interface builder backend with support for an immediate mode style API. So it provides a way to define non-mutating UI state, an immediate mode style API for dynamic UI components (lists,trees,...) and a combination of both.

The core implementation is ~800 LOC without any kind of default widgets or extensions. At first this seems quite counter intuitive. However since the inherent design allows for lots of different ways to define any widget like buttons it does not make sense to provide a specific default implementation. The way this code was architectured furthermore removes the need for style/skinning configurations used in Nuklear since widget painting is just calling a small

@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@sleekweasel
sleekweasel / README.md
Last active February 10, 2019 11:44
Hooks for recording video of cucumber tests
@sleekweasel
sleekweasel / README.md
Last active January 5, 2017 15:11
Videocapture applescript needs clickdrag.m to do its mouse clicking.

CLI video capture for iOS: the applescript uses the clickdrag tool to select the given window.

  • To start recording Simulator: osascript videocapture.scpt start Simulator 1 /Users/username/bin/clickdrag
  • To stop recording and save movie: osascript videoccapture.scpt stop /Users/username/Movies/somename
  • To stop recording without saving movie: osascript videocapture.scpt stop

Used by https://gist.github.com/sleekweasel/227315961b0b102e82d9 for automatic recording of test execution in cucumber.

Probably, if I renamed 'videocapture.scpt' to 'videocapture.applescript' and put a #!env osascript line at the start, it would be better.