Skip to content

Instantly share code, notes, and snippets.

View corasan's full-sized avatar
:octocat:
Being productive

Henry Paulino corasan

:octocat:
Being productive
View GitHub Profile
@corasan
corasan / release.ts
Created January 23, 2026 14:39
Custom release script for expo apps with Bun
#!/usr/bin/env bun
import { $ } from 'bun'
const VALID_BUMPS = ['patch', 'minor', 'major'] as const
type Bump = (typeof VALID_BUMPS)[number]
function bumpVersion(current: string, bump: Bump): string {
const [major, minor, patch] = current.split('.').map(Number)
switch (bump) {
@corasan
corasan / atomWithMmkvStorage.ts
Created November 16, 2025 00:05 — forked from MarceloPrado/atomWithMmkvStorage.ts
A simple Jotai atom with storage using react-native-mmkv backend
// `storage` is just a MMKV instance from `react-native-mmkv`
import { storage } from "@/app/storage";
import { atomWithStorage } from "jotai/utils";
const defaultOpts = { getOnInit: true };
export const atomWithMmkvBooleanStorage = (
key: string,
initialValue: boolean
) =>
@corasan
corasan / withRocketSimConnect.js
Last active March 4, 2025 21:55
Plugin for Rocket Sim Connect.
const { withAppDelegate, WarningAggregator } = require('@expo/config-plugins');
const {
mergeContents,
} = require('@expo/config-plugins/build/utils/generateCode');
const methodInvocationDefinition = `@interface RocketSimLoader : NSObject
- (void)loadRocketSimConnect;
@end
#!/bin/sh
# Install basic stuff needed for rails server deployment
apt update
apt install git -y
apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip -y
apt install postgresql postgresql-contrib -y
# Install Ruby and Rails
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
@corasan
corasan / rn-process.swift
Last active February 2, 2021 21:59
Run react-native server through Swift
func start() {
let task = Process()
let pipe = Pipe()
task.standardOutput = pipe
// remember to load your environment path
task.environment = ["PATH": path]
task.currentDirectoryPath = "Project/dir"
task.arguments = ["-c", "yarn start"]
task.launchPath = "/bin/zsh"
task.launch()
import React from 'react'
import { View, Pressable } from 'react-native'
import googleSignIn from './signIn.js'
export default function SignIn() {
return (
<View style={{ flex: 1 }}>
<Pressable onPress={googleSignIn}>
<Text>Continue with Google</Text>
</Pressable>
@corasan
corasan / functions.js
Created August 13, 2020 21:55
how to initialize Firebase Admin SDK depending if project is in Production project or Dev project
const functions = require('firebase-functions')
const admin = require('firebase-admin')
const config = JSON.parse(process.env.FIREBASE_CONFIG)
const isDev = config.projectId === 'dev-projectId'
const cert = isDev
? require('../dev-key.json')
: require('../prod-key.json')
config.credential = admin.credential.cert(cert)
@corasan
corasan / Int+Extenstion.swift
Created March 4, 2020 21:12 — forked from gbitaudeau/Int+Extenstion.swift
iOS solution to convert large numbers to smaller format. See : http://stackoverflow.com/a/35504720/1661338
extension Int {
func formatUsingAbbrevation () -> String {
let numFormatter = NSNumberFormatter()
typealias Abbrevation = (threshold:Double, divisor:Double, suffix:String)
let abbreviations:[Abbrevation] = [(0, 1, ""),
(1000.0, 1000.0, "K"),
(100_000.0, 1_000_000.0, "M"),
(100_000_000.0, 1_000_000_000.0, "B")]
.mtk6 {
color: #61e2ff;
text-shadow: 0 0 2px #001716, 0 0 5px #03edf933, 0 0 10px #ffff6633;
}
.mtk3 {
color: #72f1b8;
text-shadow: 0 0 2px #100c0f, 0 0 10px #257c55, 0 0 35px #212724;
font-style: italic;
@corasan
corasan / synthwave-x-fluoromachine.json
Last active December 21, 2019 20:20
synthwave-x-fluoromachine theme full itlaic
{
"name": "SynthWave 84",
"type": "dark",
"colors": {
"focusBorder": "#1f212b",
"foreground": "#ffffff",
"widget.shadow": "#2a2139",
"selection.background": "#34294f59",
"errorForeground": "#8a2dc0",
"textLink.activeForeground": "#61e2ff",