Skip to content

Instantly share code, notes, and snippets.

// Get the canvas element from the HTML document
var canvas = document.getElementById('myCanvas');
// Get the 2D rendering context of the canvas, which allows us to draw on it
var ctx = canvas.getContext('2d');
// Define images with their respective properties
// This is an object where we store information about our images
var images = {
// Key: 'image1.png', Value: Object containing properties of the first image
@ryanmaclean
ryanmaclean / append_etc_hosts.sh
Last active April 23, 2024 18:39
Append or Replace /etc/hosts using Tee
#! /bin/bash
echo "127.0.0.1 localhost" | sudo tee --append /etc/hosts
echo "127.0.0.1" `ec2metadata --local-hostname` | sudo tee --append /etc/hosts
## Remove --append to overwrite the file
KUMPULAN CODE TERMUX LENGKAP
| SPAM CHAT WHATSAPP || nggk usah nyepam gw -_* atau hp lu gw ledakin!!#@vms
$ pkg update && pkg upgrade
Setelah mengupdate dan mengupgrade termux ketikan perintah berikut :
$ pkg install python2 (y/n pilih y)
$ pkg install php (y/n pilih y)
$ pkg install git (y/n pilih y)
Setalah mengikuti perintah di atas waktu-nya kita clonning tool-nya :
$ git clone https://github.com/siputra12/prank.git
@reegnz
reegnz / README.md
Last active April 23, 2024 18:36
Implementing a jq REPL with fzf

Implementing a jq REPL with fzf

Update: I created jq-zsh-plugin that does this.

One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).

Another one of my favourite tools is fzf.

@holgr
holgr / README.md
Last active April 23, 2024 18:33
macOS process stealing window focus

Sean Harding finally put into words an issue that I've witnessed for a while now on macOS Sonoma.

This is it: "Weird MacOS thing: the window I am working in will sometimes lose focus (without the app losing focus). Suddenly, and without any obvious cause. It will be as if no window has focus. Sometimes happens as often as every few minutes, sometimes doesn't happen for a long time. I can’t figure out any common variable. But it can be very disruptive. Has anyone else seen this? Any ideas?"

I've adjusted the Python script mentioned in the thread to work with Python 3.x that you can get with Homebrew for example.

This is what the output looks like:

@Klerith
Klerith / instalaciones-ts.md
Last active April 23, 2024 18:33
Instalaciones del curso de TypeScript
@chranderson
chranderson / nvmCommands.js
Last active April 23, 2024 18:33
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@thdtt
thdtt / activate.cmd
Created July 15, 2021 06:12
Office 365 Activator
@echo off
title Activate Office 365 ProPlus for FREE - MSGuides.com&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products: Office 365 ProPlus (x86-x64)&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating your Office...&cscript //nologo slmgr.vbs /ck
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);