Skip to content

Instantly share code, notes, and snippets.

@breadchris
breadchris / thoughts-on-recipes.md
Last active October 8, 2023 10:04
Are recipes hard to follow?

For context, I am building an open source recipe site that addresses the issues that I tend to find people having when attempting a recipe. I would love to hear everyone's thoughts on this topic!

Two years ago, I was using canned chili and soylent as input to my biological computer (ie. I ate food, I didn't make food). Once I was exposed to resources like The Food Lab and SFAH, like many of you here, my life changed. I was repulsed by dishes that were not treated with care, and my mind's eye was opened to this new state of being. Chicken that didn't feel like rubber, eggs that weren't stink bombs, salad that I would actually look forward to eating. I evangelized The Food Lab to my friends and family, I bought them the book and delivered it to them, I did everything short of going to their door and asking "Do you have 10 minutes to talk about our Lord and Savior Kenji Lopez-Alt?". But there was no crispy oven potatoes made, or dead simple spatchcock chicken. Why wouldn't people read this damn book?

I reali

@gbrls
gbrls / game.h
Created August 8, 2021 02:56
Handmade hero hot reloading with sdl and linux
#define Kilobytes(x) ((x)*1024LL)
#define Megabytes(x) (Kilobytes(x)*(1024LL))
#define Gigabytes(x) (Megabytes(x)*(1024LL))
#define Terabytes(x) (Gigabytes(x)*(1024LL))
#define u8 unsigned char
#define u32 unsigned int
struct game_memory {
@jackdbd
jackdbd / xcb.zig
Last active January 18, 2024 14:29 — forked from NBonaparte/xcb.zig
Minimal XCB + Cairo example in Zig
//! Minimal XCB + Cairo example in Zig
//! Dependencies: libc, xcb, cairo
//! install XCB development files
//! sudo apt-get install libxcb1-dev
//! install cairo development files
//! sudo apt-get install libcairo2-dev
//! build and run with:
//! zig build-exe xcb.zig -lc -lxcb -lcairo && ./xcb
const std = @import("std");
const c = @cImport({
@vinicioslc
vinicioslc / flutter-android-cd.yml
Last active May 10, 2024 22:01
Build flutter releases in github actions for production only android for while.
# This is a basic workflow to help you get started with Actions
name: CD Internal-Lane
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "internal-v*.*.*" # on every version tag will build a new android artifact example: v3.1.2+6
jobs:
@oxinabox
oxinabox / TensorBoardLoggerDemo.ipynb
Created July 5, 2019 16:12
Note: this does get a bit carried way on using closures. Cleaner is really to just set the logger.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FrankBuss
FrankBuss / emulator.cpp
Last active April 9, 2024 05:46
RISC-V emulator (RV32I only) in one C++ file
/*
See https://gitlab.com/nedopc/npc5/blob/master/emu-rv32i.c for the latest version, with more features and less bugs :-)
RISCV emulator for the RV32I architecture
based on TinyEMU by Fabrice Bellard, see https://bellard.org/tinyemu/
stripped down for RV32I only, all "gotos" removed, and fixed some bugs for the compliance test
by Frank Buss, 2018
Requires libelf-dev:
@jaburns
jaburns / genindex.cpp
Last active March 10, 2023 18:10
Generational indices in C++ vs Rust
/*
Copyright 2021 Jeremy Burns
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@mbinna
mbinna / effective_modern_cmake.md
Last active June 19, 2024 02:23
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@Kaixhin
Kaixhin / lstms.py
Last active June 18, 2021 01:35
Collection of LSTMs
# Collection of LSTM cells (including forget gates)
# https://en.wikipedia.org/w/index.php?title=Long_short-term_memory&oldid=784163987
import torch
from torch import nn
from torch.nn import Parameter
from torch.nn import functional as F
from torch.nn.modules.utils import _pair
from torch.autograd import Variable
@bxshi
bxshi / Hits_at_K_TensorFlow.py
Created January 12, 2017 21:34
Implement Hits@K evaluation metric for Knowledge Graph Completion tasks.
import tensorflow as tf
with tf.Session() as sess:
"""
idx (h,r) top_3
[ [
[0,1], [0,8,3],
[1,3], [7,2,1],
[2,4], [4,3,9],
] ]