Skip to content

Instantly share code, notes, and snippets.

@thepont
thepont / app-module-path-for-yarn-PNP.js
Created October 3, 2018 02:00
Way of loading local modules while using yarn pnp for module loading.
var Module = require('module').Module;
var path = require('path');
var fs = require('fs');
require('./.pnp.js');
const pnpLoad = Module._load;
function fileExists(path){
try {
fs.statSync(path);
rofi.location: 0
rofi.color-enabled: true
! 'background', 'border'
rofi.color-window: #fbf1c7, #f2e5bc, #665c54
! State: 'bg', 'fg', 'bgalt', 'hlbg', 'hlfg'
rofi.color-normal: #fbf1c7, #3c3836, #ebdbb2, #bdae93, #7c6f64
rofi.color-urgent: #98971a, #8ec07c, #333333, #333333, #efa211
rofi.color-active: #cc241d, #d5c4a1, #cc241d, #bdae93, #d5c4a1
!rofi.color-urgent: #002b37, #da4281, #002b37, #003642, #da4281
!rofi.color-window: #002b37, #002b37, #003642
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

Found a great little util for backing up dynamodb to s3 from dynamodb streams, dynamodb-backup-restore.

It's designed to store each event to an S3 bucket and allow you to restore your database from the list of events.

You can add it to your serverless.yml and create a simple function.

const Backup = require('dynamodb-backup-restore').Backup;

module.exports.handler = (event, context, callback) => {
@thepont
thepont / vtrgb
Created July 26, 2016 05:41
Gruvbox /etc/console-setup/vtrgb
40,204,151,215,69,177,104,168,148,251,184,250,131,211,142,235
40,36,151,153,133,98,156,153,131,73,187,189,165,134,192,219
40,29,26,33,136,134,106,132,116,52,38,47,152,155,124,178
@thepont
thepont / i3.config
Created July 24, 2016 23:22
Gruvbox style i3 config
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Ubuntu Mono 10
@thepont
thepont / express-movie-server.js
Last active February 24, 2023 05:27
Simple Express HTTP example for streaming mp4 video from s3.
const AWS = require('aws-sdk');
const express = require('express');
const app = express();
const MOVIE_LOCATION_S3 = 'location/of/movie.mp4';
const AWS_S3_BUCKET = 's3/bucket'
const AWS_S3_ENDPOINT = 's3-ap-southeast-2.amazonaws.com'
const s3bucket = new AWS.S3(
{
@thepont
thepont / testing-comparison-table.md
Last active July 12, 2016 02:25 — forked from allanhortle/testing-comparison-table.md
Testing Comparison Table

Testing Comparison Table

##JavaScript test frameworks

Name Assertion Library Test Runner Mocks & Spies Coverage
Jest X X X X
Karma - - -
Jasmine X X X -
mocha - X - -