Skip to content

Instantly share code, notes, and snippets.

View hendrysadrak's full-sized avatar

Hendry Sadrak hendrysadrak

View GitHub Profile
@DewaldDeJager
DewaldDeJager / README.md
Last active April 8, 2025 20:50
Easy GitHub workflow for keeping a fork in sync with upstream

Sync Fork

This workflow uses the GitHub CLI to keep a forked repo in sync with the upstream repo. Add it to your repo as .github/workflows/sync-fork.yaml.

It runs daily to sync the default branch and can be triggered manually for any branch.

@rihardn
rihardn / chrome-flags-for-tools.md
Last active December 16, 2024 11:19
Chrome Flags for Tooling

Chrome Flags for Tooling

Many tools maintain a list of runtime flags for Chrome to configure the environment. This file is an attempt to document all chrome flags that are relevant to tools, automation, benchmarking, etc.

All use cases are different, so you'll have to choose which flags are most appropriate.

Here's a Nov 2022 comparison of what flags all these tools use.

Commonly unwanted browser features

@jamesdiacono
jamesdiacono / masm_to_nasm.sh
Last active October 16, 2024 15:37
The DEC64 number type for Linux (x64 and ARM), MacOS (Intel and Silicon) and Android. Include these files alongside https://github.com/douglascrockford/DEC64.
#!/bin/sh
# Translates DEC64's Windows-compatible MASM on stdin to
# UNIX-compatible NASM on stdout. Not general purpose.
# 0. Use the UNIX calling convention.
# 1. Replace equ with %define.
# 2. Replace public with global.
# 3. Replace unary macro with %macro.
# 4. Replace nullary macro with %macro.
@pesterhazy
pesterhazy / building-sync-systems.md
Last active April 28, 2025 07:41
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@santaklouse
santaklouse / CrossOver.sh
Last active April 28, 2025 13:41
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@i-like-robots
i-like-robots / fetch.js
Created March 17, 2019 11:47
Signed AWS requests with node fetch
const nodeFetch = require('node-fetch');
const httpsAgent = require('./httpsAgent');
const handleResponse = require('./handleResponse');
module.exports = async (url, options = {}) => {
const response = await nodeFetch(url, {
...options,
agent: httpsAgent
});
@atoa
atoa / delete-empty-cw-log-groups.sh
Created November 15, 2017 14:20
delete empty cloudwatch log groups
#!/usr/bin/env sh
# AWS cli delete empty cloudwatch log groups
aws logs describe-log-groups \
--query 'logGroups[?storedBytes == `0`].logGroupName' --output text | \
xargs -r -n1 aws logs delete-log-group --log-group-name
@aw
aw / mongodb-invariant-failure.md
Created March 30, 2017 06:42
[SOLUTION] MongoDB aborting after invariant() failure

I recently ran into an issue of MongoDB shell commands not working. The error message was:

Invariant failure !driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() && !osArchitecture.empty() && !osVersion.empty() src/mongo/rpc/metadata/client_metadata.cpp

I ran an strace on the mongo command and saw it was trying (and failing) to open the following files:

@PaulKinlan
PaulKinlan / monitorEvents.js
Created October 14, 2016 07:38
monitorEvents.js
function monitorEvents(element) {
var log = function(e) { console.log(e);};
var events = [];
for(var i in element) {
if(i.startsWith("on")) events.push(i.substr(2));
}
events.forEach(function(eventName) {
element.addEventListener(eventName, log);
});