Skip to content

Instantly share code, notes, and snippets.

@eNV25
eNV25 / memeinsider-dl.txt
Last active January 26, 2021 08:25
memeinsider-dl
javascript:window.location.replace("https://memeinsider.com/page-data"+window.location.pathname+"/page-data.json");
or
cdn location may change in the future so use json method first
javascript:window.location.replace(window.location.href.replace("https://","https://s3.amazonaws.com/cdn.")+".pdf")
@eNV25
eNV25 / wpa-psk.diff
Created February 6, 2021 14:31
adds CTRL-C handler and error messages to stderr
diff --git a/wpa-psk.py b/wpa-psk.py
index 0881ae3..9089caf 100644
--- a/wpa-psk.py
+++ b/wpa-psk.py
@@ -4,6 +4,12 @@ import sys
from argparse import ArgumentParser
from getpass import getpass
from hashlib import pbkdf2_hmac
+from signal import signal, SIGINT
+
@eNV25
eNV25 / tasks.txt
Created March 1, 2021 10:42
Google Tasks URL
https://tasks.google.com/embed/?origin=https://calendar.google.com
@eNV25
eNV25 / freezer-bin.diff
Created April 17, 2021 19:03
fixed PKGBUILD for freezer
diff --git a/PKGBUILD b/PKGBUILD
index f59da3b..ed010c0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,33 +1,22 @@
# Maintainer: Xandar Null <xandar.null@gmail.com>
pkgname=freezer-bin
+_pkgname_=freezer
pkgver=1.1.18
@eNV25
eNV25 / state_machine.c++
Last active April 17, 2021 19:09
State machine where each state is represented by a function.
#include "state_machine.h"
#include <iostream>
using namespace std;
struct StateFn {
State f;
StateFn(State p) : f(p) {}
operator State(void) { return f; }
@eNV25
eNV25 / fibonacci-generator.js
Last active May 17, 2021 07:35 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
export function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0n;
let next = 1n;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
}
}
@eNV25
eNV25 / main.go
Created May 18, 2021 17:35
tcell ChannelEvents examples
package main
import (
"fmt"
"os"
"strings"
"github.com/gdamore/tcell/v2"
"github.com/gdamore/tcell/v2/encoding"
"github.com/mattn/go-runewidth"

Keybase proof

I hereby claim:

  • I am env25 on github.
  • I am env25 (https://keybase.io/env25) on keybase.
  • I have a public key ASDE5jYkU8sq2BQfR6Pv-6wYAW68ifCPPbkv6xfknPM8ego

To claim this, I am signing this object:

color0 #000000
color1 #d81029
color2 #00c172
color3 #e2e800
color4 #1571ce
color5 #c824c2
color6 #00aad1
color7 #e5e5e5
color8 #666666
color9 #fe3646
# /etc/systemd/system/timesync.service
[Unit]
Description=time sync using HTTP Date header
Wants=network-online.target network.target
After=network-online.target network.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c '{ exec {sleep}<> <(:); while ! : >/dev/tcp/time.google.com/80; do read -r -t 1 -u $$sleep; done; } 2>/dev/null; true'
ExecStart=/bin/bash -c 'timedatectl set-time "$(date +"%%Y-%%m-%%d %%H:%%M:%%S %%Z" -d"$(curl -sSI http://time.google.com | grep -i "Date: " | cut -d" " -f2-)")"'