Skip to content

Instantly share code, notes, and snippets.

Working from home

Gildas Niyigena gildniy

Working from home
View GitHub Profile
gildniy /
Created Apr 15, 2021
Classify structured data using Keras Preprocessing Layers
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorflow.keras.layers.experimental.preprocessing import \
Normalization, CategoryEncoding, IntegerLookup
dataset_url = '
gildniy / async-wrapper.js
Created Sep 15, 2020
Async wrapper, replacing try catch
View async-wrapper.js
/* The async wrapper, replacing try catch block */
// eslint-disable-next-line no-unused-vars
const asyncWrapper = fn => (...args) => fn(...args).catch(args[2]);
gildniy / dynamodb_batch_delete.js
Created Sep 9, 2020 — forked from rproenca/dynamodb_batch_delete.js
Delete multiple items in a DynamoDB table
View dynamodb_batch_delete.js
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}`;
View Visual Studio 2017 Enterprise & Professional
Enterprise: NJVYC-BMHX2-G77MM-4XJMR-6Q8QF
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 / nodeAsyncTest.js
Created Jul 14, 2020 — forked from aescarcha/nodeAsyncTest.js
Javascript async / await resolving promises at the same time test
View nodeAsyncTest.js
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
}, time);
gildniy / delay.js
Created Jul 14, 2020 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
View delay.js
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
gildniy /
Created Jun 26, 2020 — forked from mathisonian/
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:


gildniy / setTimeOut.test.js
Created Jun 23, 2020
Why setTimeOut is not always a good option?
View setTimeOut.test.js
let someVar1 = 0;
const changeVar1 = () => {
someVar1 = 10;
return someVar1;
gildniy / RecipeItem.js
Created Jan 15, 2020 — forked from pylnata/RecipeItem.js
Jest+Enzyme example unit test with SHALLOW for React component using useEffect and (useDispatch, useSelector) hooks
View RecipeItem.js
import React from "react";
export const Recipeitem = (props) => {
return (<div>
gildniy / test.spec.jsx
Last active Oct 31, 2019
Testing a React Functional Component using Enzyme
View test.spec.jsx
import React from 'react';
import {shallow} from "enzyme";
const numbersArr = ["One", "Two", "Three"];
const Count123array = () => (
<div className="my-text">