Skip to content

Instantly share code, notes, and snippets.

View netroy's full-sized avatar

कारतोफ्फेलस्क्रिप्ट™ netroy

View GitHub Profile
@netroy
netroy / lambda-pinpoint.js
Last active March 20, 2024 18:49
Use A Lambda function to send an SMS over Amazon Pinpoint
const appId = [[PINPOINT_APPLICATION_ID]];
const destination = [[YOUR_PHONE_NUMBER]];
const { Pinpoint } = require('aws-sdk');
const pinpoint = new Pinpoint();
const payloadFn = (appId, destination, message) => {
const ApplicationId = appId;
const Addresses = {};
@netroy
netroy / dnsmasq.conf
Last active December 24, 2022 12:15
my local dns proxy config
no-resolv
no-poll
address=/.dev/127.0.0.1
strict-order
## dns.watch
server=84.200.69.80
server=84.200.70.40
## German Privacy Foundation
@netroy
netroy / code.py
Last active December 12, 2021 06:36
circuitpython clock for Lilygo TTGO T8 ESP32-S2
import struct
import time
import board
import displayio
import rtc
import socketpool
import terminalio
import wifi
from adafruit_display_text import label
@netroy
netroy / Changes
Last active May 14, 2021 10:01
3018 notes
$3=2
$10=115
$32=1
$100=800.000
$101=800.000
$102=800.000
$110=1500.000
$111=1500.000
$112=1200.000
$120=300.000
@netroy
netroy / git tutorials.md
Created October 27, 2011 10:09
Awesome git tutorials I am finding here and there
IMPORTANT: this is outdated, go to https://github.com/netroy/Lockets
"npm install socket-io" & you are ready to go
@netroy
netroy / lambda.js
Created August 20, 2018 12:47
Multi Origin Cloudfront (using Lambda@Edge)
"use strict";
const { promisify } = require('util');
const { resolveCname } = require('dns');
const resolveCnameAsync = promisify(resolveCname);
let resultCache = null;
const deferClearCache = () => setTimeout(() => { resultCache = null }, 1000);
const resolve = async () => {
@netroy
netroy / backup.js
Last active November 19, 2019 18:39
backup data from Wunderlist web app
var exporter = requirejs.s.contexts._.defined["backend/export"]
exporter.fetchAllTheData()
.fail(e => console.log("error", e))
.done(data => {
var link = exporter.getBlobLink(data)
document.body.appendChild(link)
link.click()
})
@netroy
netroy / 0-readme.md
Last active November 9, 2019 18:29
Easy theming with CSS vars, calc, & HSL

To test this,

  1. setup Vue prototyping tools yarn global add @vue/cli @vue/cli-service-global, or npm install -g @vue/cli @vue/cli-service-global
  2. run vue serve TestDarkMode.vue
  3. open http://localhost:8080/
  4. profit???
@netroy
netroy / 000-server.js
Created November 5, 2011 11:30
Using cluster to scale existing Express/Connect apps
var cluster = require('cluster'),
app = require('./app');
var workers = {},
count = require('os').cpus().length;
function spawn(){
var worker = cluster.fork();
workers[worker.pid] = worker;
return worker;