Skip to content

Instantly share code, notes, and snippets.

View jameswritescode's full-sized avatar
✍️

James Newton jameswritescode

✍️
View GitHub Profile

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@slikts
slikts / advanced-memo.md
Last active February 25, 2025 15:19
Advanced memoization and effects in React

nelabs.dev

Advanced memoization and effects in React

Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.

Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:

  • Memoization means caching the output based on the input; in the case of functions, it means caching the return value based on the arguments.
  • Values and references are unfortunately overloaded terms that can refer to the low-level implementation details of assignments in a language like C++, for example, or to memory
@havenwood
havenwood / fiberator.rb
Created January 20, 2020 15:49
My WIP implementation of Enumerator backed by a Fiber (like the actually are) but in pure Ruby
# frozen_string_literal: true
require 'delegate'
class Fiberator < DelegateClass Fiber
class Rewind < StandardError
end
NOTHING = Object.new
private_constant :NOTHING
@fnky
fnky / ANSI.md
Last active May 5, 2025 16:20
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@lxe
lxe / goes16-rtlsdr.md
Last active April 9, 2025 14:33
Receive GOES-16 and GOES-17 Images with a Raspberry Pi and RTL-SDR dongle
@joshnuss
joshnuss / udp_server.exs
Last active June 17, 2024 11:45
Fault tolerant UDP Server in Elixir
# to run:
# > elixir --no-halt udp_server.exs
# to test:
# > echo "hello world" | nc -u -w0 localhost 2052
# > echo "quit" | nc -u -w0 localhost 2052
# Let's call our module "UDPServer"
defmodule UDPServer do
# Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers
use GenServer
@jbkopecky
jbkopecky / seoul256.vim
Created November 10, 2016 13:27
Seoul256 own custom vim Airline theme (vim/autoload/airline/themes/seoul256.vim)
let g:airline#themes#seoul256#palette = {}
function! airline#themes#seoul256#refresh()
let M0 = airline#themes#get_highlight('Special')
let accents_group = airline#themes#get_highlight('Special')
let modified_group = [M0[0], '', M0[2], '', '']
let warning_group = airline#themes#get_highlight2(['airline_warning', 'bg'], ['airline_warning', 'fg'])
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLine', 'fg'])
@arbelt
arbelt / init.lua
Created October 2, 2016 20:55
Hammerspoon config to send escape on short ctrl press
ctrl_table = {
sends_escape = true,
last_mods = {}
}
control_key_timer = hs.timer.delayed.new(0.15, function()
ctrl_table["send_escape"] = false
-- log.i("timer fired")
-- control_key_timer:stop()
end

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@CMCDragonkai
CMCDragonkai / fold_ideas.md
Last active June 11, 2024 02:53
Haskell: Foldl vs Foldr

Foldl vs Foldr

I like to call foldr as "fold from the right", while foldl is "fold from the left".