Skip to content

Instantly share code, notes, and snippets.

@wichopy
wichopy / gist:e23463ad6c63b7cf9211736b46590c0a
Created October 29, 2023 02:01
Resolving bad dns errors for bun docker service
If you get the following type of error when trying to deploy a node / bun service as a docker container:
`10.57.42.1:3000: error trying to connect: Connection refused (os error 111)`
To fix, set the hostname to `0.0.0.0`
@wichopy
wichopy / gist:95fad00444be9d2de9d3acd95ffde0ed
Created April 24, 2023 20:20
Configure webpack in microfrontends to work with cors and error monitoring libraries
error monitoring needs your javascript bundles to allow CORS with the Access-Control-Allow-Origin header and to set the annonymous value on the crossorigin attribute in the script tag.
See rollbar docs:
https://rollbar.com/knowledge-base/unknownscript-error/
To configure this in webpack, simply update the output property:
https://webpack.js.org/configuration/output/#outputcrossoriginloading
@wichopy
wichopy / osx_bootstrap.sh
Last active November 4, 2020 14:28 — forked from mrichman/osx_bootstrap.sh
Bootstrap script for setting up a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@wichopy
wichopy / machine.js
Last active August 20, 2020 20:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wichopy
wichopy / machine.js
Created August 20, 2020 19:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wichopy
wichopy / decompile-android-apk-instructions.md
Created February 9, 2020 19:16
How to decompile an APK file.
  1. Install docker
  2. docker pull opensecurity/mobile-security-framework-mobsf
  3. docker run -it -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
  4. Go to localhost:8000 in the browser
  5. Drag and drop an APK file.
  6. View the code!
@wichopy
wichopy / scriptloader.js
Created December 2, 2019 18:36
A generic script loader class for loading external scripts in React
class ScriptLoader {
constructor() {
this.loadedSDKs = [];
this.sdks = {
stripe: {
src: 'https://js.stripe.com/v3/',
id: 'stripe-jssdk',
globalName: 'Stripe',
},
@wichopy
wichopy / main.yml
Created November 21, 2019 00:48
Github action to deploy to a google storage bucket.
name: DEPLOY-ON-PUSH
on: [push]
jobs:
deploy:
name: Deploy new build
runs-on: ubuntu-latest
steps:

Keybase proof

I hereby claim:

  • I am wichopy on github.
  • I am wichopy (https://keybase.io/wichopy) on keybase.
  • I have a public key whose fingerprint is 7658 0331 4DB7 C2E0 833A 44FD 5BAC 3985 7ECF C68B

To claim this, I am signing this object:

@wichopy
wichopy / gist:315c76626dd405340de3cd3aefb66310
Created July 31, 2019 03:51
brew installing my trace route (MTR) and manually sym linking
# Brew cannot sym link this app on its own due to permissions, this is how to do it manually:
brew install mtr
# brew link mtr // will return error
# sudo brew link mtr // will return warning about how its dangerous to run brew in sudo
# Manually sym link the path to your mtr install to your local bin folder.
# Check the version by going to /usr/local/Cellar/mtr