Skip to content

Instantly share code, notes, and snippets.

@aahan
aahan / fetch_kindle.js
Created January 17, 2021 13:13 — forked from yangchenyun/fetch_kindle.js
Get back my books from Kindle
/*
* @fileoverview Program to free the content in kindle books as plain HTML.
*
* This is largely based on reverse engineering kindle cloud app
* (https://read.amazon.com) to read book data from webSQL.
*
* Access to kindle library is required to download this book.
*/
// The Kindle Compression Module copied from http://read.amazon.com application
@aahan
aahan / nginx.conf
Created August 15, 2016 11:18 — forked from markjaquith/nginx.conf
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#359",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
<?php
function h5bs_enqueue_scripts() {
wp_enqueue_script( 'typekit', '//use.typekit.net/xxxxxxx.js' );
}
add_action( 'wp_enqueue_scripts', 'h5bs_enqueue_scripts' );
function h5bs_typekit_inline() {
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
<?php
/**
* Plugin Name: Snippets Shortcode
* Plugin URI: http://wordpress.stackexchange.com/q/116044/12615
* Description: Add code snippets as a Custom Post Type. Display in regular posts and pages using a Shortcode. Rendered with Google Prettify in frontend.
* Version: 1.0
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com
* License: GPLv2 or later
*
/* Delete revisions */
DELETE FROM wp_posts WHERE post_type = "revision";
/* Only use this if you no longer care about any of your current revisions! */
/* Delete trashed posts */
DELETE FROM wp_posts WHERE post_type = "trash";
/* Delete Unapproved comments */
DELETE FROM wp_comments WHERE comment_approved = "0";
/* Only use this if you no longer care about the current queue of unapproved comments! */