Skip to content

Instantly share code, notes, and snippets.

View Trippnology's full-sized avatar

Trippnology Trippnology

View GitHub Profile
@Trippnology
Trippnology / gist:11268174
Last active August 29, 2015 14:00
Twitter Profile Compactor
@-moz-document domain("twitter.com") {
p[class*="TweetTextSize--"] {
margin-bottom: 0;
font-size: 16px !important;
line-height: 1.333 !important; }
}
@Trippnology
Trippnology / .htaccess
Created February 16, 2015 12:22
Block SEMalt botnet
# 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 / wp-debug-variable.php
Created November 12, 2015 15:18
WP: Debug a variable
<?php echo '<pre>'; var_dump( $post ); echo '</pre>'; ?>
@Trippnology
Trippnology / auto-copyright.php
Created November 17, 2015 19:52
WP: Automatic copyright date and link
@Trippnology
Trippnology / gist:4569601
Created January 18, 2013 23:35
Shell: ASCII border
box() { t="$1xxxx";c=${2:-=}; echo ${t//?/$c}; echo "$c $1 $c"; echo ${t//?/$c}; }
@Trippnology
Trippnology / .htaccess
Created February 25, 2013 14:49
Apache: 5G Blacklist 2013 (for .htaccess)
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# 5G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]
@Trippnology
Trippnology / .editorconfig
Last active December 15, 2015 06:39
Editor Config
# editorconfig.org
root = true
[*]
indent_style = tab
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@Trippnology
Trippnology / gist:5280633
Created March 31, 2013 13:47
Windows: Run anything as a service
sc create shortname binpath= "\"C:\Path\To\Your\program.exe\" --your-program-options" displayname= "Full Name of Service for Service Manager" start= auto
@Trippnology
Trippnology / cut-the-mustard.js
Created May 16, 2013 19:51
JS: BBC "Cutting the mustard" test
// http://responsivenews.co.uk/post/18948466399/cutting-the-mustard
if('querySelector' in document
&& 'localStorage' in window
&& 'addEventListener' in window) {
// bootstrap the javascript application
}
@Trippnology
Trippnology / gist:5671947
Created May 29, 2013 17:06
Facebook like button that validates. Now outdated, see http://developers.facebook.com/docs/reference/plugins/like/
<script type="text/javascript">
//<![CDATA[
(function() {
document.write('<fb:like width="200"></fb:like>');
var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://connect.facebook.net/en_US/all.js#xfbml=1';
s1.parentNode.insertBefore(s, s1);
})();