Initialize a git repo in the current directory
# git init
Add a remote called "origin"
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
Initialize a git repo in the current directory
# git init
Add a remote called "origin"
by xero updated 10.29.24
ansible-playbook --connection=local 127.0.0.1 playbook.yml
127.0.0.1 ansible_connection=local
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
RUN curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ | |
&& tar -xvvzf ioncube.tar.gz \ | |
&& mv ioncube/ioncube_loader_lin_5.6.so `php-config --extension-dir` \ | |
&& rm -Rf ioncube.tar.gz ioncube \ | |
&& docker-php-ext-enable ioncube_loader_lin_5.6 |
/* | |
Incredibly simple Node.js and Express application server for serving static assets. | |
DON'T USE THIS IN PRODUCTION! | |
It is meant for learning purposes only. This server is not optimized for performance, | |
and is missing key features such as error pages, compression, and caching. | |
For production, I recommend using an application framework that supports server-side rendering, | |
such as Next.js. https://nextjs.org |
import { useState, useCallback, useRef } from "react"; | |
// Usage | |
function App() { | |
const [hoverRef, isHovered] = useHover(); | |
return ( | |
<div ref={hoverRef}> | |
{isHovered ? '😁' : '☹️'} | |
</div> |
// app.js: register the route. In our case, we don't want authorization for this route | |
app.use('/healthcheck', require('./routes/healthcheck.routes')); | |
// healthcheck.routes.js: return a 2xx response when your server is healthy, else send a 5xx response | |
import express from 'express'; | |
const router = express.Router({}); | |
router.get('/', async (_req, res, _next) => { | |
// optional: add further things to check (e.g. connecting to dababase) |