Skip to content

Instantly share code, notes, and snippets.

@astuyve
astuyve / deny_snippet.json
Created January 17, 2024 15:00
Deny cloudwatch permissions from Lambda to save money
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
@TheRamsay
TheRamsay / test.py
Last active October 30, 2022 22:40
IZP first project tester
#!/usr/bin/python3
#
# Testy pro 1. IZP projekt [2022]
# Autor: - Ramsay#2303
# Inspirace https://github.com/JosefKuchar/izp-projekt-1/blob/main/test.py
# Priklady pouziti:
# python3 ./test.py t9search
# python3 ./test.py t9search --bonus 2
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 3, 2024 20:03
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@y21
y21 / vm2.js
Last active April 6, 2023 07:16
vm2
const {NodeVM} = require('vm2');
const {isMainThread, Worker, parentPort} = require('worker_threads');
if (isMainThread) {
const worker = new Worker(__filename);
let lastMessage = null;
worker.on('message', () => lastMessage = Date.now());
worker.on('online', () => lastMessage = Date.now());
@gagregrog
gagregrog / github_deploy_keys_with_pm2.md
Last active September 4, 2022 20:15
Using GitHub Deploy Keys with PM2

PM2, EC2, and Github

Set Up Deploy Key on Remote Server

  1. SSH into the target machine
  2. Make a deploy_keys folder and change into it
    1. mkdir ~/.ssh/deploy_keys
    2. cd ~/.ssh/deploy_keys
  3. Create a new key pair
  4. ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@ryu1kn
ryu1kn / README.md
Last active March 18, 2024 14:19
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

@johanalkstal
johanalkstal / example.js
Last active April 29, 2024 03:12
Basic Svelte Store Routing
/**
* Basic example of routerless store based routing.
* To understand what is going on check out
* https://svelte.dev/tutorial/writable-stores
* https://www.npmjs.com/package/feather-route-matcher
*/
// stores.js
@vakila
vakila / SingleArrow.ipynb
Created April 12, 2019 07:23
Anjana Vakil, "The Universe in a Single Arrow", JSHeroes 2019
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.