Skip to content

Instantly share code, notes, and snippets.

View 0xch4z's full-sized avatar
🪣

Charlie Kenney 0xch4z

🪣
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>charbar</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
<style>
body {
margin: 0;
@0xch4z
0xch4z / README.md
Created November 4, 2023 18:16
Building zig from source on macOS arm64
git clone [email protected]:ziglang/zig.git
cd zig

mkdir build
cd build
cmake .. -DZIG_STATIC_LLVM=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)"
make -j9 install
provider "linode" {
}
resource "linode_domain" "mydomain" {
type = "master"
domain = "testingtesting123.com"
soa_email = "[email protected]"
}
resource "linode_domain_record" "jrecordbind_A" {
@0xch4z
0xch4z / dockerhub-update-image.sh
Last active December 25, 2019 03:26
An example use-case for Dockerhub Update via docker image
docker run -v $(PWD):./docs/docker-image.md:/data/readme.md:ro \
-e DOCKERHUB_USERNAME -e DOCKERHUB_PASSWORD \
charliekenney23/dockerhub-update \
-readme /data/readme.md \
-description "Some insightful description" \
myorganization/myrepository
@0xch4z
0xch4z / dockerhub-update-cmd.sh
Last active December 25, 2019 03:16
An example use-case for Dockerhub Update
dockerhub-update
-readme ./docs/docker-image.md \
-description "Some insightful description" \
myorganization/myrepository
@0xch4z
0xch4z / isTouchScreenDevice.js
Last active October 23, 2018 19:14
Useful snippet to test if a devices has a touch screen.
const isTouchScreenDevice = () => {
try {
window.document.createEvent('TouchEvent');
// if can create touch event without error
// the device has a touch screen
return true;
} catch (err) {
// swallow error and return false
return false;
}
@0xch4z
0xch4z / delete_all_docker_containers.sh
Created September 18, 2018 18:38
Delete all docker images in one line
docker container ls | awk '{print $3}' | xargs docker container rm --force
@0xch4z
0xch4z / delete_all_docker_images.sh
Created September 18, 2018 18:37
Delete all docker images in one line
docker image ls | awk '{print $3}' | xargs docker image rm --force
// chunk array reduces the array to a set of chunks of size n
const chunkArray = (a = [], n = 2) =>
a.reduce((acc, el, idx) => {
const chunk = Math.floor(idx / n);
if (!Array.isArray(acc[chunk])) acc[chunk] = [];
acc[chunk].push(el);
return acc;
}, []);
(() => {
const doneBtn = document.querySelector('.dy-html-editor-done');
['disabled', 'aria-disabled', 'ng-disabled']
.forEach(a => doneBtn.removeAttribute(a));
})();