Skip to content

Instantly share code, notes, and snippets.

View amir-arad's full-sized avatar

Amir Arad amir-arad

  • Tel-aviv, Israel
View GitHub Profile
@amir-arad
amir-arad / make-key.js
Created May 7, 2020 06:47
deterministic RSA keys
const forge = require('node-forge');
const rsa = forge.pki.rsa;
function fix (str) {
return str.replace(/\r/g, '') + '\n'
}
exports.makeKey = function makeKey(id){
const prng = {
getBytesSync(_length){
const _id = '_' + id;
return {
@amir-arad
amir-arad / make-workflow.js
Created March 31, 2019 13:43
generate github actions workflow automatically for yarn monorepo
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
const moduleNames = fs.readdirSync(path.resolve(__dirname, '..', 'modules'), {withFileTypes:true}).filter(n => n.isDirectory()).map(n => n.name);
fs.writeFileSync(path.join(__dirname, 'main.workflow'), repoScript(moduleNames));
@amir-arad
amir-arad / c_cpp_properties.json
Last active February 26, 2021 10:54
An opinionated EmptyEpsilon development setup for windows
{
"configurations": [
{
"name": "win32",
"includePath": [
"${workspaceFolder}/src",
"${workspaceFolder}/../SeriousProton/src",
"${workspaceFolder}/../SFML-2.5.1/include"
],
"browse" : {
@amir-arad
amir-arad / vorpal.d.ts
Created February 9, 2018 08:34
WIP type descriptors for vorpal
// Type definitions for vorpal 1.12.0
// Project: https://github.com/dthree/vorpal
// Definitions by: Jim Buck <http://github.com/jimmyboh>, Amir Arad <greenshade@gmail.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="inquirer" />
/// <reference types="minimist" />
declare module "vorpal" {
import {ParsedArgs} from 'minimist';
@amir-arad
amir-arad / lodash.d.ts
Last active January 11, 2022 17:24 — forked from albohlabs/lodash.d.ts
fixed to pass strict mode validation, plus some generic types here and there
// https://raw.githubusercontent.com/donnut/typescript-ramda/master/ramda.d.ts
// https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/lodash/lodash.d.ts
declare namespace fp {
interface Dictionary<T> {
[index: string]: T;
}
interface CurriedFunction1<T1, R> {
@amir-arad
amir-arad / bluebird-ext.d.ts
Created November 21, 2016 18:53
an addition to the bluebird descriptors
import * as Bluebird from "@types/bluebird";
declare module "bluebird" {
/**
* Returns a promise that is resolved by a node style callback function.
*/
export function fromNode<T>(resolver: (callback: (err: any, result?: Bluebird<T>) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird<T>;
export function fromCallback<T>(resolver: (callback: (err: any, result?: Bluebird<T>) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird<T>;
}