Skip to content

Instantly share code, notes, and snippets.

@coder054
coder054 / active.md
Created January 3, 2025 20:54 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@coder054
coder054 / .envrc
Created November 3, 2024 20:29 — forked from D7x7w9pHnT-cmd/.envrc
Purescript Environment and IDE in Nix
# Use with direnv. I use it in zsh and it seems to work pretty well for me.
# https://nixos.wiki/wiki/Development_environment_with_nix-shell
# https://direnv.net/
use_nix
# introudce new language server
# - set max completion results len to 20
# - completions will return before snippets by default
[language-server.scls]
command = "simple-completion-language-server"
[language-server.scls.config]
max_completion_items = 20 # set max completion results len for each group: words, snippets, unicode-input
snippets_first = true # completions will return before snippets by default
@coder054
coder054 / init.lua
Created September 9, 2024 03:12 — forked from leafac/init.lua
Hammerspoon Snippets
hs.alert("Hammerspoon configuration loaded")
hs.hotkey.bind({"⌥", "⌃"}, "return", function() hs.reload() end)
hs.hotkey.bind({"⌥", "⌃"}, ",",
function() hs.execute([[code ~/.hammerspoon]], true) end)
hs.hotkey.bind({"⌥", "⌃"}, "space", function() hs.toggleConsole() end)
hs.hotkey.bind({"⌥", "⌃"}, "escape", function()
hs.osascript.applescript("beep")
hs.sound.getByName("Submarine"):play()
end)
@coder054
coder054 / n-queens.js
Last active March 4, 2024 09:02
n-queens problem
const log = (...args) => {
// console.log(...args)
document.write(...args)
document.write('<br />')
}
// get the print function (for printing the board)
const getPrint = (n) => (arr) => {
const print = () => {
let str = ''

Common Lisp Cheatsheet

Common Lisp is a general-purpose programming language with functions as first-class citizens. Don't worry about being purely functional, Lisp is Object Oriented too. CLOS is a very powerful object-oriented system!

Useful definitions

The Common Lisp lingo is quite unique:

  • Package: Basically a namespace, a place for symbols to live
  • System: Basically a Library. A bunch of code plus some instructions how it should be treated, for example which other systems it depends on, what should be loaded and/or compiled first, etc. Not in ANSI lisp but widespread. The most common system definition tool is ASDF.
  • Modules: Deprecated and implementation-dependent
  • Quicklisp: Like NPM or Ruby Gems for ASDF Systems.
@coder054
coder054 / parser.js
Created February 17, 2024 13:16 — forked from atungare/parser.js
JS lisp parser
function readToken (token) {
if (token === '(') {
return {
type: 'OPENING_PARENS'
};
} else if (token === ')') {
return {
type: 'CLOSING_PARENS'
};
} else if (token.match(/^\d+$/)) {

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@coder054
coder054 / README.md
Created October 26, 2023 02:45 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@coder054
coder054 / downshift-example.js
Created October 9, 2023 04:43 — forked from JofArnold/downshift-example.js
Example of how to use Downshift as a controlled component with arbitrary items
// Untested code, but hopefully it gives you an idea.
// Ping me @jofarnold on Twitter if you get stuck
import React, { Component } from "react";
import Downshift from "downshift";
import PropTypes from "prop-types";
function nodeFromItem(id, items) {
return items.find(({ uuid }) => uuid === id);
}