Skip to content

Instantly share code, notes, and snippets.

View giacomocerquone's full-sized avatar
🧠
Obsession beats talent, always.

Giacomo Cerquone giacomocerquone

🧠
Obsession beats talent, always.
View GitHub Profile
@autotrof
autotrof / App.tsx
Last active February 3, 2024 20:33
encrypt decrypt file in react native [working with large file]. using react-native-fs and node-forge
import React from 'react';
import { StyleSheet, Text, View, PermissionsAndroid, ProgressBarAndroid } from 'react-native';
import RNFS from 'react-native-fs'
import forge from 'node-forge'
import {Buffer} from 'buffer'
import zlib from 'react-zlib-js'
const key = forge.random.getBytesSync(16);
const iv = forge.random.getBytesSync(16);
const limit_big = 1024*512;
@bbudd
bbudd / assets.md
Created June 13, 2019 12:30
Loading static assets using electron-forge v6 and the webpack plugin

I spent a few hours chasing down just how to get my static assets (css, fonts, images) to load in an Electron app built using electron-forge v6 (https://www.electronforge.io/) and its webpack plugin (https://www.electronforge.io/config/plugins/webpack) while in development mode. There really isn't any documentation available online, either in the electron-forge documentation or in places like blogs or gists or stackoverflow. So I thought I'd put it down here.

Step 1

Load CopyWebpackPlugin npm i -D copy-webpack-plugin


Step 2

Use the plugin to move your directories into place.

@alexhawkins
alexhawkins / nativeJavaScript.js
Last active April 28, 2024 08:52
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests