Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

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

🎯
Focusing
  • Berlin, Germany
Block or report user

Report or block netroy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@netroy
netroy / lambda-pinpoint.js
Last active Nov 19, 2019
Use A Lambda function to send an SMS over Amazon Pinpoint
View lambda-pinpoint.js
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 / 0-readme.md
Last active Nov 9, 2019
Easy theming with CSS vars, calc, & HSL
View 0-readme.md

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 / backup.js
Last active Nov 19, 2019
backup data from Wunderlist web app
View backup.js
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 / benchmark-resize.js
Created Nov 14, 2018
Benchmark image resize modules
View benchmark-resize.js
const sharp = require('sharp')
const Jimp = require('jimp')
const { Suite } = require('benchmark')
var suite = new Suite()
// add tests
suite
.add('Sharp', {
defer: true,
@netroy
netroy / lambda.js
Created Aug 20, 2018
Multi Origin Cloudfront (using Lambda@Edge)
View lambda.js
"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 () => {
View generators-vs-asyncawait-vs-native-promises.js
const co = require('co')
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite
const Generate = () => new Promise(resolve => {
// resolve(1)
setImmediate(() => resolve(1))
// setTimeout(() => resolve(1), 10)
})
@netroy
netroy / maze.js
Last active Aug 15, 2017
Soundcloud's follower-maze challenge in Javascript
View maze.js
// This code could use comments, tests, & a million other things..
// but since I did not apply at soundcloud, it doesn't matter
const net = require('net')
const split = require('split')
const PriorityQueue = require('priorityqueuejs')
const clients = {}
const followers = {}
const queue = new PriorityQueue((a, b) => b.sequence - a.sequence)
@netroy
netroy / index.js
Last active Aug 15, 2017
fitbit oauth
View index.js
const OAuth2 = require('oauth').OAuth2
const Koa = require('koa')
const router = require('koa-router')()
const querystring = require('querystring')
const FITBIT_KEY = '---'
const FITBIT_SECRET = '---'
const baseUrl = 'https://www.fitbit.com'
const authUrl = '/oauth2/authorize'
View gist:ca81346ae079bd9668d34ef179b41cee
[].slice.call(document.querySelectorAll('[title="Remove"]')).forEach((y,t) => setTimeout(()=>{y.click()}, t*500))
View name_it.go
package main
import (
"fmt"
"math/rand"
"time"
)
// Shamelessly borrowed from docker
var adjectives = []string{
You can’t perform that action at this time.