Skip to content

Instantly share code, notes, and snippets.

Peter Mescalchin magnetikonline

Block or report user

Report or block magnetikonline

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
magnetikonline / gist:4386671
Last active Dec 10, 2015
Webalizer IgnoreAgent/SearchEngine rule sets conf - 2012-12
View gist:4386671
IgnoreAgent Aboundex/*
IgnoreAgent AdsBot-Google*
IgnoreAgent Aghaven/*
IgnoreAgent Alltop/*
IgnoreAgent AppEngine-Google*
IgnoreAgent Apple-PubSub/*
IgnoreAgent AppleSyndication/*
IgnoreAgent BacklinkCrawler*
IgnoreAgent Baiduspider*
IgnoreAgent bitlybot
magnetikonline /
Last active Jun 22, 2018
Bookmarklet to pretty print Gist pages without the usual page chrome, just content.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');'print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
  • Now print
magnetikonline / magentodenynginx.conf
Last active Dec 12, 2015
Magento Nginx default deny ruleset.
View magentodenynginx.conf
# a fairly complete set of deny rules for Magento when running under Nginx webserver
# replicating functionality from the .htaccess files present in a base install.
location ~ "\.htaccess$" {
deny all;
location ^~ /app/ {
deny all;
magnetikonline /
Last active Dec 12, 2015
Find and list all file types recursively from the current directory with file counts.
find . -type f | sed 's/.*\.//' | sort | uniq -c
magnetikonline /
Last active Aug 9, 2017
Creating a remote Git repository.
magnetikonline /
Last active Oct 19, 2018
Truncate Git history to after specific SHA1, dropping everything at and before it.
#!/bin/bash -e
# Inspired by:
if [[ (-z $1) || (-z $2) ]]; then
echo "Usage: $(basename "$0") DROP_AT_SHA1 BRANCH"
exit 1
if [[ ! $1 =~ ^[0-9a-f]{7,40}$ ]]; then
echo "Error: invalid Git commit SHA1" >&2
magnetikonline / example.scss
Last active Dec 14, 2015
Sass media query @mixin example.
View example.scss
$breakSmall: 320px;
$breakLarge: 1024px;
@mixin respondTo($media) {
@if ($media == handhelds) {
@media only screen and (max-width: $breakSmall) { @content; }
@else if ($media == medium-screens) {
@media only screen and (min-width: $breakSmall + 1) and (max-width: $breakLarge - 1) { @content; }
magnetikonline /
Last active Aug 30, 2019
Recursively pre-compress (gzip) CSS/JavaScript/webfont assets for use Nginx and its HttpGzipStaticModule module.
#!/bin/bash -e
function compressResource {
gzip --best "$1" >"$1.gz"
touch --no-create --reference="$1" "$1.gz"
echo "Compressed: $1 > $1.gz"
magnetikonline / .screenrc
Last active Dec 14, 2015
Some GNU Screen .screenrc stuff.
View .screenrc
caption always "%{= kw}%-w%{= rw}%n %t%{-}%+w %-="
defscrollback 30000
escape ^Aa
vbell off
You can’t perform that action at this time.