Skip to content

Instantly share code, notes, and snippets.

View Noitidart's full-sized avatar

Noitidart Noitidart

View GitHub Profile
import * as FileSystem from 'expo-file-system';
import { Platform } from 'react-native';
import { IStorageEngine } from 'lib/persistoid';
import { addDebugBreadcrumb, addErrorBreadcrumb } from 'lib/sentry';
function isAndroidMissingFileOrDirectoryError(error: unknown) {
if (
Platform.OS === 'android' &&
hasMessage(error) &&
@Noitidart
Noitidart / _ff-addon-snippet-IsWorktationLocked.js
Last active February 10, 2025 05:58
_ff-addon-snippet-IsWorktationLocked - Detects if workstation is locked or not. (Windows) (jsctypes)
Cu.import('resource://gre/modules/ctypes.jsm')
var wintypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.BOOL = ctypes.bool;
this.DWORD = ctypes.uint32_t;
this.HANDLE = ctypes.voidptr_t;
this.INT = ctypes.int;
this.PVOID = ctypes.voidptr_t;
@Noitidart
Noitidart / _git-submodule-tips.md
Last active August 8, 2024 23:59
Tips for working with git submodules

Tips for Working With git Submodules

Cloning Repo with Submodules

  1. Use the --recursive flag:

     git clone https://github.com/aikiframework/json.git --recursive
    

    However if you cannot, as Github desktop app on clone does not use this flag, then do this after clone:

@Noitidart
Noitidart / _template-BootstrapJSM.xpi
Last active July 25, 2024 13:07
ff-addon-template: Template for how to create a JSM module.
function splitCubicBezier(options) {
var z = options.z,
cz = z-1,
z2 = z*z,
cz2 = cz*cz,
z3 = z2*z,
cz3 = cz2*cz,
x = options.x,
y = options.y;
@Noitidart
Noitidart / _js-snippet-CubicBezierSplit2.js
Created May 5, 2014 06:22
_js-snippet-CubicBezierSplit2 - This split method is from iScriptDesign.com under "Tutorial > Split Bezier" I'm posting here in case that site goes down.
Split bezier
Shows the possibility to split a bezier curve, two separate techniques are used:
Bernstein's Polynomials
Casteljau's Algorithm
Bernstein's Polynomials
The Bernstein Polynomial implemented in javascript reads as:
getBezier = function getBez(percent,p1,cp1,cp2,p2) {
@Noitidart
Noitidart / _ff-addon-snippet-WinAPI_resultHexToStr.js
Last active October 18, 2023 07:42
_ff-addon-snippet-WinAPI_resultHexToStr - Convert hex error to str.
var WIN32_ERROR_STR = {
HRESULT: {
'STG_S_CONVERTED': 0x00030200,
'STG_S_BLOCK': 0x00030201,
'STG_S_RETRYNOW': 0x00030202,
'STG_S_MONITORING': 0x00030203,
'STG_S_MULTIPLEOPENS': 0x00030204,
'STG_S_CONSOLIDATIONFAILED': 0x00030205,
'STG_S_CANNOTCONSOLIDATE': 0x00030206,
'OLE_S_USEREG': 0x00040000,
function useRenderCounter(label) {
const ref = React.useRef();
React.useEffect(() => {
ref.current.textContent = [
parseInt(ref.current.textContent || "0", 10) + 1,
label
]
.filter(Boolean)
.join(" - ");
});
{
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": false,
"plaintext": false,
"markdown": false,
"scminput": false,
"ts": true,
"js": true,
"jsx": true,
@Noitidart
Noitidart / Beamoff Tool.iso
Last active October 20, 2022 12:21
Shows how to install OSX 10.10.1 onto Oracle VirtualBox on AMD