Skip to content

Instantly share code, notes, and snippets.

@jun9
jun9 / txt2mp3.sh
Created July 23, 2022 19:14 — forked from ivanistheone/txt2mp3.sh
This script converts a plain text file, e.g. article.txt into a mp3 audiobook using the MacOS text-to-speech accessibility command-line tool `say`. Adjust the `VOICE` and `RATE` parameters to customize to your liking. Note this requires running on MacOS.
#!/usr/bin/env bash
set -e
# This script converts any text file into a mp3 audiobook using the MacOS
# text-to-speech accessibility command-line tool `say`.
# Adjust the `VOICE` and `RATE` parameters to customize to your liking:
VOICE="Alex"
RATE="295" # pretty fast
if [ $# -eq 0 ]; then
@jun9
jun9 / create_php_site.sh
Created September 17, 2012 11:57
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@jun9
jun9 / generate-client.sh
Created December 7, 2021 05:09 — forked from judge2020/generate-client.sh
Generate a new client configuration for WireGuard
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "$0 client-name"
exit 1
fi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h1>
<ruby>我<rt>diāo</rt></ruby>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.sample-form-document {
background: #fff;
max-width: 615px;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background: black;
}
@jun9
jun9 / README.md
Created November 21, 2012 03:09 — forked from mbostock/.block
Bullet Charts

Designed by Stephen Few, a bullet chart “provides a rich display of data in a small space.” A variation on a bar chart, bullet charts compare a given quantitative measure (such as profit or revenue) against qualitative ranges (e.g., poor, satisfactory, good) and related markers (e.g., the same measure a year ago). Layout inspired by Stephen Few. Implementation based on work by Clint Ivy, Jamie Love of N-Squared Software and Jason Davies. The "update" button randomizes the values slightly to demonstrate transitions.

Neural Network XOR

Widget Menagerie

@jun9
jun9 / points.r
Last active December 24, 2015 21:19 — forked from hadley/points.r
library(ggplot2)
library(scales)
library(maps)
library(plyr)
mid_range <- function(x) mean(range(x, na.rm = TRUE))
centres <- ddply(county_df, c("state", "county"), summarise,
lat = mid_range(lat),
long = mid_range(long)
)