Skip to content

Instantly share code, notes, and snippets.

View scambier's full-sized avatar

Simon Cambier scambier

View GitHub Profile
@Fevol
Fevol / buttonlist.ts
Last active December 23, 2022 23:28
Obsidian - Add Button List Component
// Copy this entire file into your source directory, you can adapt it if you want
// This code is written in a way that makes use of the same interface as all other Obsidian settings components
import {setIcon, Setting, ValueComponent} from "obsidian";
declare module "obsidian" {
interface Setting {
addButtonList(cb: (component: ButtonListComponent) => any): this;
}
}
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @grant none
// @version 1.2.0
// @author @chaoticvibing - GH @busybox11 - forked by GH @jso8910
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/jso8910/738753b00f4fbf850d2661deb0670a98/raw/2c228b25ddb1b36c22f3ad475ecb3f0dd8930660/twitterblue-nerd.js
// @downloadURL https://gist.githubusercontent.com/jso8910/738753b00f4fbf850d2661deb0670a98/raw/2c228b25ddb1b36c22f3ad475ecb3f0dd8930660/twitterblue-nerd.js
@tesselode
tesselode / swept-aabb.lua
Last active February 8, 2025 17:06
swept AABB collision detection implemented in Lua (commentated)
--[[
moves rectangle A by (dx, dy) and checks for a collision
with rectangle B.
if no collision occurs, returns false.
if a collision does occur, returns:
- the time within the movement when the collision occurs (from 0-1)
- the x component of the normal vector
- the y component of the normal vector
@kometbomb
kometbomb / put-a-flip-in-it.p8
Last active June 5, 2024 15:39
#PutAFlipInIt! #pico8
-- 1. Paste this at the very bottom of your PICO-8
-- cart
-- 2. Hit return and select the menu item to save
-- a slow render gif (it's all automatic!)
-- 3. Tweet the gif with #PutAFlipInIt
--
-- Notes:
--
-- This relies on the max gif length being long
-- enough. This can be set with the -gif_len
@cheerfulstoic
cheerfulstoic / Repository Maintenance Levels.md
Last active October 31, 2024 10:28
Repository Maintenance Levels

After reading Why I'm Frequently Absent from Open Source by James Long and listening the corresponding The Changelog episode, I dwelt on the idea and believe that open source maintainers...

  • ... should never be ashamed if they don't have time for a project.
  • ... should be honest with themselves and open with their users so that everybody can be on the same page
  • ... are people and they have at one time or another responsibilities or hardships that they need to attend to which reasonably take them away from a project
  • ... may also reasonbly decide that they don't like the direction of a project or that they would like to explore other things and may leave a project permanently.

Along this line of thinking I've created a set of descriptions for different levels at which a project might be maintained. A maintainer can use these to announce to their users the current ability that they have to dedicate to a pr

@370417
370417 / shadowcasting.js
Created April 24, 2016 15:10
Symmetric recursive shadowcasting
/**
* Recursive shadowcasting algorithm.
* This algorithm creates a field of view centered around (x, y).
* Opaque tiles are treated as if they have beveled edges.
* Transparent tiles are visible only if their center is visible, so the
* algorithm is symmetric.
* @param cx - x coordinate of center
* @param cy - y coordinate of center
* @param transparent - function that takes (x, y) as arguments and returns the transparency of that tile
* @param reveal - callback function that reveals the tile at (x, y)
@josefnpat
josefnpat / readme.md
Last active February 1, 2025 07:08
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 4, 2025 01:46
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@samselikoff
samselikoff / future-proof.md
Last active August 15, 2024 15:17
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@manmal
manmal / UIImageView+AFNetworkingFadeInAdditions.h
Last active August 27, 2017 17:31
Very minimalistic fade-in implementation for AFNetworking's UIImageView category. Thanks to @myellow and @merowing_.
#import <AFNetworking.h>
@interface UIImageView (AFNetworkingFadeInAdditions)
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholderImage fadeInWithDuration:(CGFloat)duration;
@end