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.
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.
#!/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. |
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.
Database in a browser, a spec (Stepan Parunashvili)
What problem are we trying to solve with a sync system?
The web of tomorrow (Nikita Prokopov)
#!/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]); | |
} | |
} |
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 | |
}); | |
#!/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 |
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:
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); | |
}); |