Skip to content

Instantly share code, notes, and snippets.

@graeme-winter
graeme-winter / hello_world.py
Created April 8, 2021 07:41
Hello, world! on a Pimoroni pico scroll, using show_bitmap_1d() method (includes full character set definition)
# generate 5x7 font bitmap as 5 bytes / char
#
# (C) Graeme Winter, 2021
#
# Encoding: each column of 7 bits is encoded top down with LSB as top ->
# horizontal line across the top is 0x01 0x01 0x01 0x01 0x01, vertical line
# on left side of box only would be 0x7f 0x00 0x00 0x00 0x00.
__bitmap = {
0x0: (0x0, 0x0, 0x0, 0x0, 0x0),
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AjkayAlan
AjkayAlan / WSLWindows10Setup.md
Last active April 29, 2024 15:43
Windows SubSystem For Linux setup that I like with some developers stuff mixed in

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update
Using events with 6144 elements
Warming up --------------------------------------
each 1.000 i/100ms
map 1.000 i/100ms
map + uniq 1.000 i/100ms
map + set 1.000 i/100ms
chunked by thread 1.000 i/100ms
chunked by thread 1.000 i/100ms
Calculating -------------------------------------
each 2.569 (± 3.7%) i/s - 26.000 in 10.237953s
@abbottdev
abbottdev / app.ts
Created June 11, 2019 13:52
Typescript example for creating aws cdk resources using a swaggerfile
import * as cdk from '@aws-cdk/cdk';
import * as SwaggerParser from "swagger-parser";
import convertSwaggerToCdkRestApi from "./swaggerHelper";
SwaggerParser
.parse("./swagger.yaml")
.then(swagger => {
const app = new cdk.App();
let apiGateway = new apigateway.RestApi(this, "My Rest API", {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rcx
rcx / delete-all-messages.js
Last active November 9, 2023 19:12 — forked from niahoo/delete-all-messages.js
Delete all your messages in a Discord channel
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
clearMessages = function (guild_id, author_id, authToken, deleted = new Set()) {
if (guild_id[0] == "_" && guild_id[guild_id.length - 1] == "_") {
alert("Oops! You forgot to set the guild_id. Please fill it in.")
return;
}
if (author_id[0] == "_" && author_id[author_id.length - 1] == "_") {
package main
import (
"fmt"
"image"
"image/color/palette"
"image/draw"
"image/gif"
"log"
"math/rand"
@btamayo
btamayo / del_cluster.sh
Last active October 15, 2024 13:27 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
killall pmxcfs
@CSRaghunandan
CSRaghunandan / nginx.conf
Last active November 1, 2024 21:12
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;