Skip to content

Instantly share code, notes, and snippets.

View gildniy's full-sized avatar
🌏
Remote

Gildas Niyigena gildniy

🌏
Remote
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gildniy
gildniy / node-modules-in-react-native.md
Created November 19, 2022 18:02 — forked from parshap/node-modules-in-react-native.md
Running Node Modules in React Native

Running Node Modules in React Native

How to use packages that depend on Node.js core modules in React Native.

See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.

Node.js Core Modules

@gildniy
gildniy / video_stabilize.py
Created August 8, 2022 06:17 — forked from DatHuynh/video_stabilize.py
Video stabilization with OpenCV and Hugin
#!/usr/bin/env python
""" Video stabilization with OpenCV (>=2.3) and Hugin
Adrien Gaidon
INRIA - 2012
TODO: add cropping, clean-up and improve doc-strings
"""
@gildniy
gildniy / warp.py
Last active May 13, 2022 08:40 — forked from nikgens/warp.py
from __future__ import division
import cv2
import numpy as np
import matplotlib.pyplot as plt
import os
os.chdir('C:/Users/gennady.nikitin/Dropbox/Coding/OpenCV')
# define variable for resize tratio
ratio = 1
@gildniy
gildniy / repair-mysql-data.ps1
Created April 30, 2022 19:15 — forked from josemmo/repair-mysql-data.ps1
Repair MySQL data directory (for XAMPP)
# Based on this answer: https://stackoverflow.com/a/61859561/1956278
# Backup old data
Rename-Item -Path "./data" -NewName "./data_old"
# Create new data directory
Copy-Item -Path "./backup" -Destination "./data" -Recurse
Remove-Item "./data/test" -Recurse
$dbPaths = Get-ChildItem -Path "./data_old" -Exclude ('mysql', 'performance_schema', 'phpmyadmin') -Recurse -Directory
Copy-Item -Path $dbPaths.FullName -Destination "./data" -Recurse
@gildniy
gildniy / dynamodb_batch_delete.js
Created September 9, 2020 23:16 — forked from rproenca/dynamodb_batch_delete.js
Delete multiple items in a DynamoDB table
const AWS = require('aws-sdk');
const {parallelScan} = require('@shelf/dynamodb-parallel-scan');
const TABLE_NAME = '[table-name]';
const PRIMARY_PARTITION_KEY = '[partition-key]';
async function fetchAll() {
const CONCURRENCY = 250;
const alias = `#${PRIMARY_PARTITION_KEY}`;
const name = PRIMARY_PARTITION_KEY;
Enterprise: NJVYC-BMHX2-G77MM-4XJMR-6Q8QF
Professional: KBJFW-NXHK6-W4WJM-CRMQB-G3CDH
Keys are generic ones. These are the same from MSDN account.
Product Key : -6Q8QF
Validity : Valid
Product ID : 00369-90000-00000-AA703
Advanced ID : XXXXX-03699-000-000000-00-1032-9200.0000-0672017
@gildniy
gildniy / nodeAsyncTest.js
Created July 14, 2020 18:54 — forked from aescarcha/nodeAsyncTest.js
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
@gildniy
gildniy / delay.js
Created July 14, 2020 18:53 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
@gildniy
gildniy / index.md
Created June 26, 2020 05:10 — forked from mathisonian/index.md
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration