Skip to content

Instantly share code, notes, and snippets.

View palerdot's full-sized avatar
💭
.

Arun Kumar palerdot

💭
.
View GitHub Profile
@cfreshman
cfreshman / wordle-nyt-answers-alphabetical.txt
Last active April 3, 2024 23:40
(NO LONGER ACCURATE - NYT now curates answers per-day, see all possible guesses https://gist.github.com/cfreshman/d97dbe7004522f7bc52ed2a6e22e2c04). NYTimes Wordle answers from source code in alphabetical order. Additional allowed guesses (12546 words as of 9/2): https://gist.github.com/cfreshman/d5fb56316158a1575898bba1eed3b5da (original: https…
aback
abase
abate
abbey
abbot
abhor
abide
abled
abode
abort
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@silmeth
silmeth / rust_serde_base64_bytes.rs
Created May 16, 2019 18:49
Serialization and deserialization byte array (Vec<u8>) to/from json in Rust as Base64 string using Serde
use serde::{Deserialize, Deserializer, Serialize, Serializer};
#[derive(Serialize, Deserialize, Debug)]
pub struct Foo {
#[serde(serialize_with = "as_base64", deserialize_with = "from_base64")]
bytes: Vec<u8>,
}
fn as_base64<T: AsRef<[u8]>, S: Serializer>(val: &T, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(&base64::encode(val))
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
use std::rc::Rc;
/*
Types
*/
@mrx06
mrx06 / uninstall paragon ntfs 15 full
Created September 3, 2018 17:17
full uninstall paragon ntfs 15 (reset trial)
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
sudo rm -rf /Library/PreferencePanes/ParagonNTFS.prefPane
@zioproto
zioproto / redis-delete-old-keys.py
Last active March 3, 2023 18:45
Delete Redis Stale Keys
#!/usr/bin/env python
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
# To debug code on a single key you can use this instead of the for loops:
# key = r.randomkey()
# Delete all keys not accessed since 'idletime'
for key in r.scan_iter("*"):
idle = r.object("idletime", key)
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@mrothNET
mrothNET / LetsEncrypt+certbot+UFW+postfix+dovecot.md
Last active October 27, 2023 00:36
Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

This tutorial describes how to install TLS to a mail server consisting of Postfix and/or Dovecot by using Let's Encrypt certificates with automatic renewing and firewall management.

The system used for this tutorial was:

$ lsb_release -idrc
Distributor ID: Ubuntu
@fasiha
fasiha / no-hackerrank.md
Last active August 7, 2023 11:47
A prospective employer invited me to do a HackerRank test. Here's my proposed alternative.

Well, that was unexpected. In the following, I’m trying to follow Jon Evans’ advice from “The Terrible Technical Interview”.


To: recruitment@EmployerABC.com
From: Ahmed Fasih
Subject: Re: Programming Test Invitation

Hi there! Thanks for offering to let me take a HackerRank test for ABC, I appreciate the vote of confidence.

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.