Skip to content

Instantly share code, notes, and snippets.

View cem2ran's full-sized avatar
⚛️
~ The only constant is change ~

Cem Turan cem2ran

⚛️
~ The only constant is change ~
View GitHub Profile
@angerman
angerman / Installation.md
Last active February 1, 2024 11:38
Installing nix on macOS BigSur

The nixos.org website suggests to use:

sh <(curl -L https://nixos.org/nix/install)

For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
#!/usr/bin/env bash
###
# NB: You probably don't want this gist any more.
# Instead, use this version from `fastsetup`:
# https://github.com/fastai/fastsetup/blob/master/setup-conda.sh
###
set -e
cd
@threepointone
threepointone / feature-flags.md
Last active May 24, 2023 11:03
Feature flags: why, how, all that

(I'm enjoying doing these raw, barely edited writeups; I hope they're useful to you too)

Feature flags

This is my own writeup on feature flags; for a deep dive I'd recommend something like Martin Fowler's article (https://martinfowler.com/articles/feature-toggles.html).

So. Feature flags. The basic idea that you'll store configuration/values on a database/service somewhere, and by changing those values, you can change the user experience/features for a user on the fly.

Let's say that you're building a new feature, called 'new-button' which changes the color of buttons, which is currently red, to blue. Then you'd change code that looks like this -

import SwiftUI
import PlaygroundSupport
// NOTE: this example currently only works with US-based coordinates
// constants
// New York
let latitude = 40.709335
let longitude = -73.956558
@jaredpalmer
jaredpalmer / react-scripts+3.4.1.patch
Created May 26, 2020 14:46
Speed up Create React App with TypeScript in development
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js
index 25840d9..25c3c41 100644
--- a/node_modules/react-scripts/config/webpack.config.js
+++ b/node_modules/react-scripts/config/webpack.config.js
@@ -172,7 +172,7 @@ module.exports = function(webpackEnv) {
// The build folder.
path: isEnvProduction ? paths.appBuild : undefined,
// Add /* filename */ comments to generated require()s in the output.
- pathinfo: isEnvDevelopment,
+ pathinfo: false,

Reading the (already impressive) compiled output in helper.bs.js in the tutorial by Michele Riva on Calling ReasonML from TypeScript, I thought the output could be made nearly identical (bar comments and some weird nest paren wrapping) to what an experienced dev might write by hand

If we:

  1. have Flat-variants-(and polymorphic-variants)-as-strings (see
  2. Omit String(x) when x is already a string (already merged): rescript-lang/rescript-compiler#4293
  3. Propogate the variable names from destructuring a tuple to the output (see ideal_output_2.bs.js)
  4. Don't do nested parens inside of {j|$x foo $y bar $z baz|j} output

Then the output (minus the /* tuple */ comments) would be exactly what you'd write by hand!

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active March 26, 2024 02:51
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@hartmut27
hartmut27 / monitoring_start.sh
Last active April 30, 2020 07:11
One-click Quadruple Monitoring Startup Script (tmux automate): Jest watch, Alcotest watch, Backend HTTP-Server watch, Frontend HTTP-Server watch
#!/bin/sh
tmux new-session -s 'S1' \; \
attach -t 'S1' \; \
set -g pane-border-status top \; \
set -g base-index 1 \; \
set -g pane-base-index 1 \; \
rename-window -t 0 'W0' \; \
\
select-pane -T "Jest watch" \; \
send-keys 'npm run watch:test' C-m \; \
@MatthiasPortzel
MatthiasPortzel / sandcastle-mac-iphone7-android.md
Last active March 10, 2024 16:39
A walkthrough of downloading Android on an iPhone 7 and getting setup

This tutorial is going to walk you through taking an unjailbroken iPhone 7, and a Mac, and installing Android on the phone using Project Sandcastle.

  • Download Project Sandcastle from here. We want the Android build.
  • This document follows the instructions under the Mac section of the README, but with more detail and extra setup help at the end.

Perform a Checkra1n jailbreak

  • Download Checkra1n from here.
  • Move the Checkra1n app to /Applications/Checkra1n.app (this is important later).
  • Connect your phone to the computer
  • Launch the checkra1n app, and perform the jailbreak as described.
#lang rosette/safe
(require rosette/lib/angelic
(only-in racket/base syntax->datum))
(define-syntax-rule (define-distinct v x ...)
(begin
(define x v) ...
(assert (distinct? x ...))))
(define-syntax-rule (list-choices x ... sol)
(list (list (evaluate x sol) (syntax->datum #'x)) ...))