Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
atomtigerzoo / add-a-class-to-pinterest-embeds.html
Last active July 11, 2018 09:02
Add 'pinthis' class to images that should have the pinterest button - Wordpress-Editor-inline-safe
<script async defer data-pin-hover="true" data-pin-tall="true" data-pin-save="true" src="//assets.pinterest.com/js/pinit.js"></script>
<script type="text/javascript">function defer(method){if (window.jQuery){method();}else{setTimeout(function() {defer(method)}, 50);}}defer(function(){ $("img").each(function(){ if(!$(this).hasClass("pinthis")){ $(this).attr("nopin", "true"); } });});</script>
@atomtigerzoo
atomtigerzoo / fail2ban_block-ip-from-commandline.md
Last active February 4, 2018 15:34
Block IP with fail2ban from command line

A quick block for clients that bother you somehow or do malicious stuff.

List your jails

 sudo fail2ban-client status

Choose the jail you want to block the IP from/add it to.

Block the IP

@atomtigerzoo
atomtigerzoo / break-long-words-with-hypens.css
Created December 29, 2017 06:14
CSS: break long words with auto-hyphens
.hyphen-long-words{
hyphens: auto;
overflow-wrap: break-word;
}
@atomtigerzoo
atomtigerzoo / gh-pages-deploy.md
Created August 29, 2017 08:47 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

Keybase proof

I hereby claim:

  • I am atomtigerzoo on github.
  • I am atomtigerzoo (https://keybase.io/atomtigerzoo) on keybase.
  • I have a public key ASCf1duP-wmkXpvYF6F8-Rf-bn4U49uhsNiT65ynL9Benwo

To claim this, I am signing this object:

@atomtigerzoo
atomtigerzoo / auto-hotkeys.ahk
Created September 23, 2016 09:06
My Autohotkey script
;
; Useful hotkeys
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; !=ALT, +=Shift, ^=STRG, #=WINDOWS-Key
How to install the VirtualBox Guest Additions in debian wheezy
$ su -
$ apt-get update && apt-get upgrade
Install needed packages
$ apt-get install build-essential module-assistant
Configure your system for building kernel modules
$ running m-a prepare
@atomtigerzoo
atomtigerzoo / relay-mail-to-external-smtp.md
Last active February 16, 2016 11:23
A simple way to send mails from a virtual server to another SMTP host for relaying/forwarding mails. Suitable for development - or just for kicks on a virtual server.

Relay mails to an external SMTP server

This shows you how to send mails from a - in this case virtual debian server inside VirtualBox - server to an external SMTP server. You can use your own server, Gmail or any other SMTP server you have access to.

This can then be used to send mail from PHP, Rails, Python, console or whatever you like.

The steps are for a debian wheezy server.

@atomtigerzoo
atomtigerzoo / box-shadow-inset.css
Created November 17, 2015 10:07
CSS snippet with inset shadow examples for reference.
.inset-top{
box-shadow: inset 0 7px 9px -7px rgba(0,0,0,0.4);
}
.inset-left{
box-shadow: inset 7px 0 9px -7px rgba(0,0,0,0.4);
}
.inset-right{
box-shadow: inset -7px 0 9px -7px rgba(0,0,0,0.4);
}
.inset-bottom{
@atomtigerzoo
atomtigerzoo / wordpress-ctp-post_id-only.php
Created July 24, 2015 10:35
Wordpress: Custom post type with post_id-only in URLs
/**
* Replace 'mycustomname' with the actual custom type post
* name to fit your needs.
*
* !! Flush rewrite rules in Wordpress backend afterwards !!
*/
/**
* Create the CTP