Skip to content

Instantly share code, notes, and snippets.

@turadg
turadg / Dockerfile
Created March 12, 2024 13:17
a3p image builders
#----------------
# upgrade-8
#----------------
## START
# on agoric-upgrade-7-2, with upgrade to agoric-upgrade-8
FROM ghcr.io/agoric/ag0:agoric-upgrade-7-2 as prepare-upgrade-8
ENV UPGRADE_TO=agoric-upgrade-8
# put env functions into shell environment
@turadg
turadg / github-expand-project-sidebar.user.js
Last active September 16, 2023 03:48
Focus the Checks view on the selected result type
// ==UserScript==
// @name GitHub project sidebar opener
// @namespace http://tampermonkey.net/
// @version 0.1
// @description On GitHub issue pages, expand the Projects sidebar by default
// @author Turadg Aleahmad
// @run-at document-idle
// @match https://github.com/*
// @require https://greasyfork.org/scripts/398877-utils-js/code/utilsjs.js?version=877686
// @icon https://github.githubassets.com/pinned-octocat.svg
@turadg
turadg / removeUnusedModules.sh
Created December 8, 2017 02:54
Find in webpack builds modules that are never imported
#!/bin/bash
echo "Testing prod build for modules in src that aren't ever imported."
echo
echo "NOTE: Any dev-only imports will appear to be unused."
USED_LIST_PATH=usedModules.txt
STATS_PATH=public/assets/stats.json
@turadg
turadg / silence-React-15-deprecations.js
Last active April 13, 2018 18:46
Jest setup file to stop React 15.5 createClass / PropTypes deprecation warnings
import React from 'react';
/**
* Since React v15.5, there's a warning printed if you access `React.createClass` or `React.PropTypes`
* https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#new-deprecation-warnings
*
* `import * as React from 'react'` is required by Flowtype https://flow.org/en/docs/react/types/ ,
* but the * causes both those deprecated getters to be called.
* This is particularly annoying in Jest since every test prints two useless warnings.
*
@turadg
turadg / generateFlowModuleNameMappers.js
Last active June 20, 2018 06:28
Helper to create .flowconfig module name mapper
#!/usr/bin/env node
/**
* Flowtype understands Node (or Haste) imports but not Webpack.
*
* Many codebases have webpack set up like:
* src/foo.js
* src/components/Bar.jsx
*
* And then import them like `require('foo')` or `require/components/Bar.jsx`
*
@turadg
turadg / swaggerTable.js
Created January 3, 2017 22:50
Generate a tab delimited table of endpoints on a Swagger-described API
#!/usr/bin/env node
/*
For Swagger 1.2 docs format.
Hardcode the base path in the urlFor() function.
Assumes Node 6+.
*/
#!/bin/bash
#
# Retroflow
#
# This makes it easier to retrofit Flow type checking onto your existing code.
#
# Given a path argument, it finds all the js/jsx files under that path that
# don't have the Flow (flowtype.org) preamble. It then adds it and runs the
# Flow check. If anything fails, it removes it again.
#
#!/bin/bash
# fork of https://codecov.io/bash
set -e +o pipefail
VERSION="0db33a1"
url="https://codecov.io"
url_o=""
verbose="0"

Keybase proof

I hereby claim:

  • I am turadg on github.
  • I am turadg (https://keybase.io/turadg) on keybase.
  • I have a public key whose fingerprint is 1AAF D87D B5DB 6B87 29A5 7646 0249 C9F5 1B7F 02C2

To claim this, I am signing this object:

/**
* The router runs this navigate action once a new route is resolved.
* This returns a promise that must be satisfied before the render
* starts. The promise consists of all actions that each handler
* in the route declares that it needs before navigating.
*
* WHEN we upgrade react-router to 1.0, we should revisit this design
* https://github.com/rackt/react-router/pull/1158
*
* @return {Promise} to satisfy all the dependencies of the route