Skip to content

Instantly share code, notes, and snippets.

Trippnology Trippnology

Block or report user

Report or block Trippnology

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:66a514e94842ab86ac7a86a1b0680670
<!-- See: https://www.filamentgroup.com/lab/load-css-simpler/ -->
<link rel="stylesheet" href="/path/to/my.css" media="print" onload="this.media='all'">
@Trippnology
Trippnology / compound-interest.js
Last active Jul 19, 2018 — forked from actuallymentor/compound-interest.js
A simple script to calculate compound interest
View compound-interest.js
// Input it initial amount
// Interest as a number, e.g. 5% is 1.05 on a yearly basis
// Length as number of years
// Name of this calculation
// Addition determines whether the input variable is one time or a yearly contribution
function compound( input, interest, length, name, addition ) {
var accumulated = input
for ( i=0; i < length; i++ ) {
accumulated *= interest
if ( addition ){
@Trippnology
Trippnology / equalise-height.js
Created Apr 3, 2018
jQuery: Equalise height of set of elements
View equalise-height.js
function equalizeHeight(selector) {
var maxheight = 0;
$(selector).each(function(){
var height = parseInt($(this).css('height'));
if (height > maxheight ) {
maxheight = height;
}
});
$(selector).css('height', maxheight);
}
@Trippnology
Trippnology / channel_v3.json
Last active Jan 3, 2016
Sublime Package Control: Backup package list
View channel_v3.json
This file has been truncated, but you can view the full file.
View .editorconfig
# editorconfig.org
root = true
[*]
indent_style = tab
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@Trippnology
Trippnology / auto-copyright.php
Created Nov 17, 2015
WP: Automatic copyright date and link
View auto-copyright.php
View wp-debug-variable.php
<?php echo '<pre>'; var_dump( $post ); echo '</pre>'; ?>
@Trippnology
Trippnology / comments.php
Created Oct 12, 2015
WP: Add Bootstrap classes to comment form
View comments.php
// Add to your theme's comments.php
<?php
$comment_args = array(
'class_submit' => 'btn btn-default submit',
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" class="form-control" cols="45" rows="8" aria-required="true" required="required"></textarea></p>',
'fields' => array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input id="author" name="author" class="form-control" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . $html_req . ' /></p>',
'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input id="email" name="email" class="form-control" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_auth
@Trippnology
Trippnology / .htaccess
Created Feb 16, 2015
Block SEMalt botnet
View .htaccess
# Source: http://www.marketingpilgrim.com/2014/08/tips-for-blocking-semalt-and-botnet-attacks.html
# Block SEMalt botnet
SetEnvIfNoCase Referer fbdownloader.com spammer=yes
SetEnvIfNoCase Referer descargar-musicas-gratis.com spammer=yes
SetEnvIfNoCase Referer baixar-musicas-gratis.com spammer=yes
SetEnvIfNoCase Referer savetubevideo.com spammer=yes
SetEnvIfNoCase Referer srecorder.com spammer=yes
SetEnvIfNoCase Referer kambasoft.com spammer=yes
SetEnvIfNoCase Referer semalt.com spammer=yes
@Trippnology
Trippnology / README.md
Last active Jan 2, 2016
Default README.md
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

You can’t perform that action at this time.