Skip to content

Instantly share code, notes, and snippets.

@DonnieWest
DonnieWest / javascript.vim
Last active September 30, 2022 01:43
Some prettier configs
let s:formatprg = findfile('node_modules/.bin/prettier-eslint', '.;')
if !executable(s:formatprg)
let s:formatprg = findfile('node_modules/.bin/prettier', '.;')
endif
if !executable(s:formatprg)
let s:formatprg = exepath('prettier-eslint')
endif
@lmakarov
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tzapu
tzapu / docker-compose.yml
Last active September 26, 2022 05:13
docker compose file for local server, plex, transmission, sonarr, radarr, ombi, netdata, nextcloud
version: '2.1'
services:
transmission:
container_name: transmission
image: dperson/transmission
restart: unless-stopped
depends_on:
- plex
network_mode: host
environment:
@tylermakin
tylermakin / Multipart MIME Email.md
Last active April 9, 2024 21:31
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: sender@example.com
To: recipient@example.com
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
@mbostock
mbostock / .gitignore
Last active September 13, 2019 01:32
Force GIF
*.png
*.gif
@ecmendenhall
ecmendenhall / check_for_hijacked_modules.sh
Last active March 23, 2016 17:55
A quick script to check npm dependencies for modules hijacked by nj48 (https://www.npmjs.com/~nj48)
#!/usr/bin/env bash
MATCHES=$(npm ls | grep -e " andthen@" \
-e " anglicize@" \
-e " ansi-codes@" \
-e " atbash@" \
-e " attr@" \
-e " attrs@" \
-e " available-slug@" \
-e " background-image@" \
@biovisualize
biovisualize / README.md
Last active September 9, 2021 16:57
d3.selection.appendHTML and appendSVG

Parse and append an HTML or SVG string. I use it a lot for appending a template, instead of generating it with d3.

d3.select('.container').appendHTML('<div><svg><g><rect width="50" height="50" /></g></svg></div>');

Unlike using .html, .appendHTML can append multiple elements

d3.select('.container').html('<span id="a"></span>');
d3.select('.container').html('<span id="b"></span>'); // will replace content
d3.select('.container').appendHTML('<span id="c"></span>'); // will append content
# theano_pong_rnn.py
# Dave Gottlieb (dmg1@stanford.edu) 2016
#
# Pong RNN model reimplemented more correctly + flexibly directly in Theano
from theano import *
import theano.tensor as T
import numpy as np
class PongRNNModel(object):
@josue
josue / pdf-conversion-fun.md
Last active December 10, 2023 15:11
Using ImageMagick to easily: Split, Merge, Remove a page from PDF.

Install Required libraries:

sudo apt-get update && sudo apt-get install imagemagick gs

create directory to test commands

mkdir -p pdf_conversion/{merged,split}
cd pdf_conversion