Skip to content

Instantly share code, notes, and snippets.

View danopia's full-sized avatar

Daniel Lamando danopia

View GitHub Profile
@aaronmdjones
aaronmdjones / freenode-resign-letter.txt
Created May 19, 2021 10:20
My resignation from freenode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
My resignation from freenode staff
==================================
I joined the freenode staff in March 2019 [1].
Before I joined the staff, Freenode Ltd was sold [2] to a person named
Andrew Lee as part of a sponsorship deal. The informal terms of that
@sindresorhus
sindresorhus / esm-package.md
Last active May 3, 2024 10:19
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@katef
katef / hattifatteners.awk
Created October 23, 2020 22:48
hattifatteners.awk
#!/usr/bin/awk -f
function hoop(h, w) {
printf("l 0 %d ", -h);
printf("c 0 -%u, %u -%u, %u 0 ", w, w, w, w);
printf("l 0 %d", +h);
}
function hand(x, h, o, l) {
printf("<g transform='translate(%d.5 %d)'>\n", x, h);
@kesor
kesor / Dockerfile
Last active August 11, 2023 21:17
Compile DENO on Alpine (w/MUSL C)
FROM rust:alpine
RUN apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
clang \
curl \
g++ \
git \
set -l data_status (curl -s https://iceportal.de/api1/rs/status)
set -l data_trip (curl -s https://iceportal.de/api1/rs/tripInfo/trip)
# next stop
echo  (echo $data_trip | jq -r '([ .trip.stops[] | select(.info.passed==false) ]
| first).station.name')
# train number
echo  (echo $data_trip | jq -r '"\(.trip.trainType)-\(.trip.vzn)"')
# speed
echo speed (echo $data_status | jq -r '"\(.speed) km/h"')
@drmalex07
drmalex07 / README-List-Directory-in-WebDAV.md
Last active November 22, 2023 16:58
List directory in WebDav #webdav

Readme - List directory in WebDAV

1. An example request

To list properties of a directory we must use the PROPFIND method of WebDAV protocol and provide a request body with properties we are interested into. We must also provide the Depth header (otherwise the request is rejected as 403 Forbidden).

To retrieve basic properties as size and type, prepare a request body (say propfind-basic.xml) as:

@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
import requests
import praw
import logging
import time
import random
import schedule
import pickle
import sys
from datetime import datetime, timedelta
@danopia
danopia / pizza_tracker.fish
Created March 3, 2018 03:22
fish functions that integrate with stardust
function pizza_tracker --description "pizza_tracker <orderNum> <subId>"
set orderNum $argv[1]
set subId $argv[2]
set apiBase "https://papajohns-api-prod.apigee.net"
set apiUri "$apiBase/api/v1/orders/$orderNum/status?subId=$subId"
set state 'None'
while [ "$state" != "Completed" ]
set newState ( curl -s $apiUri | jq -r '.orderStatus' )
set estimatedDeliveryTimeHuman ( curl -s $apiUri | jq -r '.estimatedDeliveryTimeHuman' )
@danopia
danopia / github.js
Last active September 10, 2019 03:54
GitHub webhook => colored IRC message
const { runWorker, shortenUrl, trimText, notify } = require('./_lib');
const moment = require('moment');
const multimatch = require('multimatch');
const orgChannelMap = {
'stardustapp': '#stardust',
'danopia': '#stardust',
'relrod': '#dagd',
'noexc': '#noexc',
};