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;
@aahan
aahan / ps.md
Created July 16, 2014 19:33
Windows 7 File Properties: Get 'date created' up to seconds using PowerShell

Open PowerShell: Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell

To get Date Created, run commands:

$file = Get-Item "D:\My folder\my-file.md"
$file.CreationTime

The output will look like this (in system's local time):

Wednesday, July 16, 2014 16:24:00
{
"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",
@aahan
aahan / Disqus lazy load.md
Last active December 30, 2015 12:09
Lazy loading Disqus comments (i.e. loading on scroll) can be done with these JavaScript plugins.
@aahan
aahan / style.css
Created December 1, 2013 15:01
Crop image using CSS
/*
* Crop image using CSS
*/
#top-stories figure,
#latest-stories figure {
display: block;
overflow: hidden;
width: 81px;
}
@aahan
aahan / wp-seo-filters.php
Created November 13, 2013 13:36
WordPress SEO by Yoast filters
<?php
// Remove Canonical Link Added By Yoast WordPress SEO Plugin
function at_remove_dup_canonical_link() {
return false;
}
add_filter( 'wpseo_canonical', 'at_remove_dup_canonical_link' );
function wpseo_attachment_canonical_parent( $canonical ) {
@aahan
aahan / WordPress Custom Global Variables.md
Last active March 28, 2024 19:26
Creating and using custom global variables in wordpress.

First create global variables (in functions.php or as a mu-plugin):

<?php

/*
 * CUSTOM GLOBAL VARIABLES
 */
function wtnerd_global_vars() {