Skip to content

Instantly share code, notes, and snippets.

View nektro's full-sized avatar
🌻
if you know, you know

Meghan Denny nektro

🌻
if you know, you know
View GitHub Profile
@nektro
nektro / createImageBitmap.js
Created November 7, 2017 01:14
Edge and Safari Polyfill for createImageBitmap
/* Safari and Edge polyfill for createImageBitmap
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
*/
if (!('createImageBitmap' in window)) {
window.createImageBitmap = async function(blob) {
return new Promise((resolve,reject) => {
let img = document.createElement('img');
img.addEventListener('load', function() {
resolve(this);
});
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJL/Tmw2oZFIZVoW1CBq5RQWOD9ntGxXWCOLksaiGAWy hello+limitless@nektro.net
#!/usr/bin/env bash
set -e
for number in $(gh pr list --search "status:failure -is:draft" --json 'number' | jq '.[].number')
do
echo '## Checking out PR' $number
gh pr checkout $number
echo
#!/usr/bin/env bash
todo='0'
echo "[" > todo_data.json
git log --reverse --oneline |
while IFS= read -r commit
do
hash=$(echo $commit | cut -d' ' -f1)
function fib(n, i = 0, a = 0, b = 1) {
if (n === i) { return a; }
return fib(n, i + 1, b, a + b);
}
@nektro
nektro / Dockerfile
Created March 19, 2021 08:57
minimal requirements to build and install zig from scratch with docker
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
COPY . .
RUN apt update
RUN apt -y upgrade
RUN apt -y install apt-utils apt-transport-https ca-certificates
RUN apt -y install wget gpg
@nektro
nektro / web_view.php
Last active November 18, 2020 21:14
Open a TCP socket and create a handmade HTTP 1.1 GET request
<?php
/**
* Connect to an HTTP server and echo the response
*/
$host = 'localhost';
$port = 80;
$fp = fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
}
@nektro
nektro / network_containers.go
Created October 7, 2020 23:23
Read the names and IDs of all the containers in a docker network
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
)
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node_exporter
namespace: prometheus/node_exporter
spec:
template:
metadata:
labels:
name: node_exporter