Skip to content

Instantly share code, notes, and snippets.

@jochemstoel
jochemstoel / split_silence.sh
Created December 26, 2017 11:24 — forked from VojtechKlos/split_silence.sh
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
@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';
Loading
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 December 17, 2024 13:32
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: [email protected]
To: [email protected]
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 20, 2024 08:13
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 ([email protected]) 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):