Skip to content

Instantly share code, notes, and snippets.

@mahodder
mahodder / keybase.md
Created June 15, 2016 11:04
keybase.md

Keybase proof

I hereby claim:

  • I am mahodder on github.
  • I am markhodder (https://keybase.io/markhodder) on keybase.
  • I have a public key whose fingerprint is 28A8 B795 8562 2A4C 65A1 A040 C231 2198 B50E E378

To claim this, I am signing this object:

@mahodder
mahodder / 0_reuse_code.js
Created January 8, 2016 15:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mahodder
mahodder / grind-custom-gallery-order
Created December 15, 2014 15:21
Change Order of Tags to DESC / Grind & Genesis
@mahodder
mahodder / Custom Header Thesis 2
Last active August 29, 2015 14:05
Custom Header Thesis 2 - add this to the custom.php in the skins folder. Make sure you don't have a image uploaded in "Thesis -> Header Image"
global $thesis;
remove_filter('thesis_site_title', array($thesis->skin, 'logo'));
function my_logo($title) {
?>
<a href="http://mysite.com">
<img width="200" height="150" title="click to return home" alt="Grind T2 header image" src="http://mysite.com/header.jpg" id="thesis_header_image">
</a>
<?
}
sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
@mahodder
mahodder / Thesis MS-NGINX
Last active August 29, 2015 14:00
Thesis MS / NGINX
location / {
try_files $uri $uri/ /index.php?$args;
rewrite wp-content/thesis/skins/(.*)/css.css /wp-admin/admin-post.php?action=thesis_do_css;
}
@mahodder
mahodder / Reverse WordPress Archive Category Order
Created January 24, 2014 03:47
Reverse WordPress post order on archive pages for specific categories only - add to functions.php
add_action( 'pre_get_posts', 'custom_reverse_post_order' );
function custom_reverse_post_order( $query ) {
if ( is_admin() )
return;
if ( $query->is_main_query() && is_archive() && ! is_post_type_archive() && ($query->query_vars['category_name'] == 'category-name' || $query->query_vars['category_name'] == 'category-name') ) {
$query->set( 'orderby', 'date' );
$query->set( 'order', 'ASC' );
}
}
@mahodder
mahodder / ZIP Automator Code
Created March 14, 2013 14:38
Adds a new option to your Mac "Services" menu to zip selected folder without including .git, .DS_Store files - created zip file takes folder name. To Setup: - Search for automator on your Mac and open it - Double click "Service" - Double click Library -> Utilities -> Run Shell Script - "Services Receives selected" dropdown should be set to "file…
declare -a names
declare -a parts
declare i=0
names=("$@")
name="$1"
while x=$(dirname "$name"); [ "$x" != "/" ]
do
parts[$i]="$x"