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.
#!/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)
// 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); | |
}); |
A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:
node_modules/
bower_components/
scripts/
Entry script is in scripts/entry.js
You should run gulp && gulp build-dev
and you are good to go.