Skip to content

Instantly share code, notes, and snippets.

View derekstavis's full-sized avatar
🚀

Derek W. Stavis derekstavis

🚀
  • West Hollywood, California
View GitHub Profile
@derekstavis
derekstavis / Toast.tsx
Last active October 2, 2023 18:02
React Native Toast, without Context hell
/* Layout and Text components are my own utility components. Replace them by your own. */
import { memo, useEffect, useMemo, useState } from "react";
import { ViewStyle } from "react-native";
import { A } from "@mobily/ts-belt";
import mitt from "mitt";
import { v4 as uuid } from "@lukeed/uuid";
import Animated, {
Layout as REALayout,
Easing,
@derekstavis
derekstavis / CLA.md
Created July 14, 2022 19:46 — forked from merqurio/CLA.md
CLA Template

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all IOMED Medical Solution S.L. open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with IOMED Medical Solution S.L., contributors or maintainers.

1. Grant of Copyright License.

@derekstavis
derekstavis / typeorm+0.2.36.patch
Created June 15, 2022 15:32
typeorm + react-native-quick-sqlite async patch
diff --git a/node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js b/node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js
index c2e7890..261517b 100644
--- a/node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js
+++ b/node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js
@@ -62,7 +62,7 @@ var ReactNativeDriver = /** @class */ (function (_super) {
var databaseConnection = db;
// we need to enable foreign keys in sqlite to make sure all foreign key related features
// working properly. this also makes onDelete work with sqlite.
- databaseConnection.executeSql("PRAGMA foreign_keys = ON;", [], function (result) {
+ databaseConnection.asyncExecuteSql("PRAGMA foreign_keys = ON;", [], function (result) {
@derekstavis
derekstavis / fetch.ts
Created January 24, 2021 18:25
Gjs fetch poor polyfill
import Soup from "soup";
type Fetch = typeof fetch;
declare global {
const fetch: Fetch;
}
class Response {
session: Soup.Session;
@derekstavis
derekstavis / FastList.tsx
Last active April 30, 2024 14:50 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@derekstavis
derekstavis / bamdad.json
Last active February 2, 2019 00:38
Lottie
{"v":"4.10.1","fr":30,"ip":0,"op":296,"w":100,"h":100,"nm":"01","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"coud4 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[58.312,26.033,0],"ix":2},"a":{"a":0,"k":[74.545,21.87,0],"ix":1},"s":{"a":0,"k":[10,10,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[140.589,35.87],[148.089,35.87]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.258999992819,0.294000004787,0.475,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823999980852,0.830999995213,0.834999952129,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,10
@derekstavis
derekstavis / lex.js
Created November 28, 2018 19:53
Speak numbers in Portuguese
module.exports = (function () {
var R = require('ramda');
var factor = R.curry(function (place, value) {
var int = parseInt(value / place) * place
, dec = parseInt(value % place);
return [
int == 100 && dec > 0 ? 'centoe' : R.toString(int),
int != 100 && dec > 0 ? 'and' : [],
@derekstavis
derekstavis / README.md
Created January 15, 2018 15:29
Mostly adequate guide to Arch Linux installation

Arch Linux is a distribution that's always on the most recent version of software packages, differing from other distros like Ubuntu and Debian, which releases a major/minor of all packages just in new releases. Another good point is that on Arch most configurations are default and just work, so you won't get Canonical's or RedHat's opinions in your operating system.

Although, not everything is flowrs. Arch's installation isn't graphical, that's why I've created a time ago a sequence of commands to help friends to install Arch Linux with GNOME with the setup I consider ideal for developers.

After booting the USB drive with the installation (download at https://www.archlinux.org/download/) just follow these steps:

WARNING: You need to have UEFI boot (disable CSM mode in your BIOS)

DISCLAIMER: This will erase all the data in your computer.

@derekstavis
derekstavis / Dereks-Guide-Arch-Linux.md
Last active June 18, 2018 18:22
Derek's guide to Arch Linux

Arch Linux is a GNU/Linux distribution that's always in the newest version of software packages, differing it from versionated distributions as Ubuntu and Debian, which updates all package's major/minor only in new releases. Another good point of Arch is that all configurations are the default ones, so you don't get Canonical's or RedHat's opinions in your operating system.

Although, not everything is flowers. Arch's installation isn't graphical, that's why I've created dsome time ago a sequence of commands to help friends to get Arch Linux with GNOME with the setup I consider the best for everyone.

After creating a boot thumb drive and boot it (download in https://www.archlinux.org/download/)

%YAML 1.1
---
# Suricata configuration file. In addition to the comments describing all
# options in this file, full documentation can be found at:
# https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Suricatayaml
##
## Step 1: inform Suricata about your network
##