Skip to content

Instantly share code, notes, and snippets.

View synox's full-sized avatar

Aravindo Wingeier synox

View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@dhruska
dhruska / add-all-amex-offers.js
Last active March 17, 2023 06:33
Script to automatically add all American Express offers
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function clickAllOffers () {
const offerButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title === "Add to Card" || btn.title === "Activate Offer");
for (const offerButton of offerButtons) {
console.log("Clicking offer button");
offerButton.click();
@raviwu
raviwu / notes_soft_skills.md
Last active May 5, 2022 06:43
[Notes] Soft Skills: The software developer's life manual

Page 47

This kind of mindset is crucial to managing your career, because when you start to think of yourself as a business, you start to make good business decisions.

Page 52

Every step you take without a clear direction is a wasted step. Don’t randomly walk through life without a purpose for your career.

Your big goal should be something not too specific, but clear enough that you can know if you’re steering toward it or not. Think about what you want to ultimately do with your career.

from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
@marioosh
marioosh / ChatRoom.scala
Last active March 1, 2020 08:11
websocket based on akka-http
class ChatRoom(roomId: Int, actorSystem: ActorSystem) {
private[this] val chatRoomActor = actorSystem.actorOf(Props(classOf[ChatRoomActor], roomId))
def websocketFlow(user: String): Flow[Message, Message, _] = ???
def sendMessage(message: ChatMessage): Unit = chatRoomActor ! message
}
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@twksos
twksos / CiscoVPNConnection.scpt
Last active July 31, 2023 20:50
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
#!/bin/sh
# mass deskew scanned files via command line
# - requires: ImageMagick and Deskew Tool
# - see http://galfar.vevb.net/wp/tag/deskew
for d in "$@"; do
file=`basename "$d" .pdf`
cd "`dirname "$d"`"
@callil
callil / Sparkcore128x32i2c
Created July 4, 2014 01:54
Simple implementation of the sample script for the Adafruit 128x32 i2c OLED on the spark core. Based off this thread (https://community.spark.io/t/adafruit-ssd1306-library-ported/3505/48) and code from @pkourany (https://github.com/pkourany/Adafruit_SSD1306)
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_GFX.h"
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_SSD1306.h"
/*********************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing