Skip to content

Instantly share code, notes, and snippets.

@cheeaun
cheeaun / say.html
Created March 19, 2010 04:24
Experimental page to test html5 <audio> tag with google translate tts technology.
<!DOCTYPE html>
<title>Say it to me!</title>
<link rel="stylesheet" href="http://cheeaun.github.com/cacss/ca.min.css">
<style>
body{
text-align: center;
}
input, button{
font-size: 2em;
width: 70%;
@michalfapso
michalfapso / speak.pl
Last active January 10, 2024 00:52
Google Text-to-Speech script for processing longer texts
#!/usr/bin/perl
#--------------------------------------------------
# Usage:
# ./speak.pl en input.txt output.mp3
#
# Prerequisites:
# sudo apt-get install libwww-perl libhtml-tree-perl sox libsox-fmt-mp3
#
# Compiling sox:
@benshimmin
benshimmin / gist:4088493
Created November 16, 2012 16:03
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@mtigas
mtigas / README.md
Last active September 24, 2024 14:51
this is the nginx config for https://mike.tig.as/, with config to avoid the BEAST exploit (by using TLS 1.2+ ciphers or RC4) and enable SSL perfect forward secrecy (by preferring ECDHE ciphers)

[mike.tig.as][mta] server configuration

This gist contains the nginx and tor configurations for the [mike.tig.as][mta] servers, mainly to show:

  • Use of the chris-lea/nginx-devel PPA to allow use of SPDY.
  • ssl_ciphers selection to mitigate BEAST attack, enable [perfect forward secrecy][pfs] if possible and select the strongest possible ciphers within those bounds. (Exception is made for several ciphers at the end of list, for compatibility reasons.)
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@Stanback
Stanback / nginx.conf
Last active October 1, 2024 23:28 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active November 14, 2024 09:20
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@jhafner
jhafner / jquery-to-vanilla-js.md
Created December 16, 2013 17:52 — forked from harmstyler/moving_from_jquery.md
jQuery methods in vanilla JavaScript.

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@bookwyrm
bookwyrm / _fonts.scss
Created February 19, 2014 13:55
_fonts.scss Sass include for managing Google web fonts with Sass
$lineheight-multiplier: 1.4;
$default-lineheight: -1;
// Must be the px font-size on your html element for proper rem calculation.
$base-font-size: 16px;
$base-font: arial, sans-serif;
/**
* Just specify font-size, don't override current font.
*/
@mixin font-size($fontsize, $lineheight: $default-lineheight, $base: $base-font-size) {
@hofmannsven
hofmannsven / README.md
Last active November 8, 2023 22:49
SCSS Cheatsheet