Skip to content

Instantly share code, notes, and snippets.

@hirbod
hirbod / withDisableForcedDarkModeAndroid.js
Last active March 13, 2025 16:23
Expo Config Plugin to disable forced Dark mode.
// disable forced dark mode to prevent weird color changes
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { createRunOncePlugin, withAndroidStyles, AndroidConfig } = require('expo/config-plugins')
function setForceDarkModeToFalse(styles) {
const newStyles = AndroidConfig.Styles.assignStylesValue(styles, {
add: true,
// ############# FOLLOW IF YOU'RE ON SDK 52 #############
// TODO: AndroidConfig.Styles.getAppThemeGroup() will be available in SDK 52 (or expo/config-plugins 9+), for now I just hardcoded AppTheme
// parent: AndroidConfig.Styles.getAppThemeGroup(),
@int128
int128 / README.md
Last active December 18, 2024 08:48
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@tsbits
tsbits / [ThreeJS] Don't clear the canvas
Last active August 14, 2021 12:28
[ThreeJS] Don't clear the canvas
renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});
renderer.autoClearColor = false;
@xeoncross
xeoncross / gitstats.sh
Created November 5, 2012 21:35
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'