Skip to content

Instantly share code, notes, and snippets.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
// ImGui BFFX binding
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#include <imgui.h>
#include "imgui_impl_bgfx.h"
@solnic
solnic / rom-sql-ar-like-polymorphic-associations.rb
Last active May 14, 2021 05:33
[rom-sql] AR-like polymorphic associations (PLEASE DON'T USE IT UNLESS YOU HAVE A LEGACY SCHEMA)
require 'rom-repository'
require 'rom-sql'
require 'logger'
config = ROM::Configuration.new(:sql, 'sqlite::memory')
config.gateways[:default].connection.create_table(:songs) do
primary_key :id
column :title, String
end
@developit
developit / unistore.js
Last active September 8, 2020 15:13
Update: the newer & better version of this is published: https://github.com/developit/unistore
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
@robrix
robrix / Bidi.hs
Last active January 13, 2023 17:59
Bidirectional type elaboration for the simply-typed lambda calculus with unit values & types.
{-# LANGUAGE DeriveFunctor #-}
module Bidi where
-- For 'guard'.
import Control.Monad
-- We use Cofree to represent type-annotated terms.
import Control.Comonad.Cofree
import Data.Functor.Classes
-- We use Fix to represent unannotated terms.
import Data.Functor.Foldable
@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
/**
* ANTLR grammar file for DreamMaker (BYOND language)
* Tested a little bit with SS13 code. It works sometimes
* Doesn't support all the DreamMaker language features because nobody uses all of it and it's a huge fucking mess. My intention is to implement enough of the spec that it can parse SS13's code
* Preprocessor directives tend to make the parser shit the bed. It tries to ignore them as much as possible. Also variables in string don't really work and sometimes make it break.
* It also depends on antlr-denter: https://github.com/yshavit/antlr-denter
* Released under Apache Licence 2.0: https://www.apache.org/licenses/LICENSE-2.0
**/
grammar DreamMaker;
require 'fiddle'
class RubyVM::InstructionSequence
load_fn_addr = Fiddle::Handle::DEFAULT['rb_iseq_load']
load_fn = Fiddle::Function.new(load_fn_addr,
[Fiddle::TYPE_VOIDP] * 3,
Fiddle::TYPE_VOIDP)
define_singleton_method(:load) do |data, parent = nil, opt = nil|
load_fn.call(Fiddle.dlwrap(data), parent, opt).to_value
@smarr
smarr / truffle-material.md
Last active March 16, 2023 14:06
Truffle: Languages and Material