Skip to content

Instantly share code, notes, and snippets.

View chaoky's full-sized avatar
🦩
in a nix rebound phase

Chaoky chaoky

🦩
in a nix rebound phase
View GitHub Profile
@chaoky
chaoky / full.nix
Last active April 23, 2024 22:17
expo react native nix derivation and shell
# I'm using a wrapped mkNodeModules for pnpm support
# mkYarnModules and importNpmLock are avaible for yarn/npm in nixpkgs
# also using chaoky/gradle-dot-nix fork for the local-repos option
{ pkgs, utils, gradle-dot-nix }:
let
nodejs = pkgs.nodejs_21;
pnpm = pkgs.nodePackages.pnpm;
java = pkgs.jdk17;
androidPkgs = pkgs.androidenv.composeAndroidPackages {
//from: https://github.com/GenezysDigitalAssets/clashofcars-node-service/blob/main/src/routes/get_player_data.ts
use actix_web::{
get,
web::{Data, Json},
App, HttpServer, Result,
};
use serde::{Deserialize, Serialize};
use solana_account_decoder::parse_token::UiTokenAmount;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_program::pubkey::Pubkey;
@chaoky
chaoky / PortugeseAdjectives.js
Last active September 7, 2021 20:03
List of Portugese Adjectives CamelCase
[
'Grande',
'Bom',
'Novo',
'Pequeno',
'Próprio',
'Velho',
'Cheio',
'Branco',
'Longo',
@chaoky
chaoky / circeDecode.scala
Created September 7, 2021 19:27
Decode empty strings to None in scala circe
given emptyStringToNull[A](using d: Decoder[A]): Decoder[Option[A]] =
Decoder.decodeOption.prepare(cursor =>
cursor.withFocus(json => if json.toString == "\"\"" then Json.Null else json)
)
@chaoky
chaoky / main.rs
Last active April 13, 2020 19:50
covid_chart_thingy
use quicksilver::{
geom::{Rectangle, Vector},
graphics::{Color, Graphics},
lifecycle::{run, EventStream, Settings, Window},
Result,
};
use iced::{button, Align, Button, Column, Element, Sandbox, Text};
use iced::Settings as IcedS;
fn main() {
@chaoky
chaoky / emacsclient single gui
Created January 6, 2020 17:26
Emacs will only create a new window if none exist
e() {
#return a list of all frames on $DISPLAY
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" &>/dev/null
if [ $? -eq 0 ]; then
emacsclient -n "$@"
else
emacsclient -nc "$@"
fi
@chaoky
chaoky / .tmux.conf
Created September 30, 2019 23:05 — forked from CSaratakij/.tmux.conf
Tmux's Config that's very close to i3wm (Setting with an idea of using tmux without x-server)
# Config that is very close to a i3 window manager's keybinding.
set -s escape-time 0
setw -g aggressive-resize on
# First remove *all* keybindings
unbind-key -a
# List keys
bind-key ? list-keys
@chaoky
chaoky / fstab-generate-arch
Created September 1, 2019 06:42 — forked from Brainiarc7/fstab-generate-arch.md
Generate fstab in Arch Linux
First, install arch-install-scripts:
sudo pacman -S --needed arch-install-scripts
Secondly, mount your partitions in all the internal hard drives.
Thirdly, generate and validate your config by piping it out to stdout:
genfstab -U -p / | less
~ 3s press to enter the menu/exit/select/confirm
~ 1s press to cicle thought options
---- MENU ------
1 - Max temp 1
2 - Min temp 2 (based on max temp)
3 - Fake temp (based on max temp)
5 - Cicle duration
@chaoky
chaoky / regexCheatsheet.js
Created March 12, 2019 23:22 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"