Skip to content

Instantly share code, notes, and snippets.

@mote0230
mote0230 / mail.php
Last active April 27, 2024 08:23 — forked from rantastic/mail.php
PHP: Send email using amazon SES with AWS Signature Version 4
<?php
//class docs: http://www.orderingdisorder.com/aws/ses/
require_once('ses.php');
//get credentials at http://aws.amazon.com My Account / Console > Security Credentials
$ses = new SimpleEmailService('ACCESSkeyID', 'SECRETaccessKEY', 'eu-west-1', 'email.eu-west-1.amazonaws.com');
//print_r($ses->listVerifiedEmailAddresses());

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@sandeepsuvit
sandeepsuvit / .env
Last active April 27, 2024 08:22
nestjs file upload using multer
##
# File properties
##
UPLOAD_LOCATION=/Users/dummyusername/Documents/temp/nvaluate
# Max 5Mb allowed
MAX_FILE_SIZE=5
MAX_FILE_COUNTS=20
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 27, 2024 08:21
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@henfiber
henfiber / KB-Buying-guide-EU.md
Last active April 27, 2024 08:20
Buying keyboards and keyboard components from EU

Europe

  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • mykeyboard.eu : Keyboards, keycaps and accessories. Based in Belgium.
  • candykeys.com : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • falba.tech : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • 42keebs.eu - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
@amanjuman
amanjuman / Install V2Ray Client on OpenWRT and Configure Vmess
Last active April 27, 2024 08:19
Install V2Ray Client on OpenWRT and Configure Vmess
### The original Author of this package had enabled CloudFlare JS verification. As a result, this automated script will not work.
### Therefore you have to download each package and install it manually.
## Change Directory
cd /tmp/
## Update opkg
opkg update
## If wget not installed already
@pchiusano
pchiusano / monads.u
Last active April 27, 2024 08:18
Converting between algebraic effects and monads
-- This gist shows how we can use abilities to provide nicer syntax for any monad.
-- We can view abilities as "just" providing nicer syntax for working with the
-- free monad.
ability Monadic f where
eval : f a -> a
-- Here's a monad, encoded as a first-class value with
-- two polymorphic functions, `pure` and `bind`
type Monad f = Monad (forall a . a -> f a) (forall a b . f a -> (a -> f b) -> f b)
@krezreb
krezreb / linux power management notes.md
Last active April 27, 2024 08:20
linux power management notes

notes for setting up power management under ubuntu 22.04 (kernel 5.15) on a dell xps

I am a developer and system admin. I have a LOT of browser tabs, lots of terminals open, as well as vscode and MS Teams. YMMV but as far as I can tell, the "best" balance of power savings (long battery life) vs maching usability is using tlp and tlpui. This gives approx 5 - 6 hours of battery life on my workload.

I am running an INTEL processor, the below does not apply to AMD

TL;DR

@kcranley1
kcranley1 / workshop.py
Last active April 27, 2024 08:16
A GUI program for use with the Raspberry Pi Camera
from Tkinter import *
import time
import picamera
import RPi.GPIO as GPIO
import numpy as np
import io
from datetime import datetime, timedelta
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)