Skip to content

Instantly share code, notes, and snippets.

View hans2103's full-sized avatar
🏠
Working from home

Hans Kuijpers hans2103

🏠
Working from home
View GitHub Profile
@hans2103
hans2103 / less.watcher
Last active November 15, 2016 10:51
settings LESS watcher PHP Storm
# PHPStorm LESS watcher settings
- File type: less
- Scope: define scope of working template
- Program: /usr/local/bin/lessc
- Arguments: --clean-css="--compatibility=ie9 --advanced" --source-map-map-inline $FileName$
- Output path to refresh: ../css/$FileNameWithoutExtension$.css
- [ ] Immediate file synchronization
- [X] Track only root files

Keybase proof

I hereby claim:

  • I am hans2103 on github.
  • I am hans2103 (https://keybase.io/hans2103) on keybase.
  • I have a public key whose fingerprint is DF85 1DD0 9930 BBC8 820B 9AFE BB87 F14D 2EA1 3B00

To claim this, I am signing this object:

@hans2103
hans2103 / error.php
Last active July 14, 2017 12:59
Joomla! error.php template override
<?php
/*
* @package perfecttemplate
* @copyright Copyright (c) Perfect Web Team / perfectwebteam.nl
* @license GNU General Public License version 3 or later
*/
// No direct access.
defined('_JEXEC') or die;
@hans2103
hans2103 / remove squeezbox
Created August 4, 2016 08:08
Removal of SqueezeBox in Joomla! frontend head
// what is added
<script type="text/javascript">
jQuery(function($) {
SqueezeBox.initialize({});
SqueezeBox.assign($('a.modal').get(), {
parse: 'rel'
});
});
@hans2103
hans2103 / server.badbots
Last active May 8, 2024 17:33
NGINX to block bad bots. (add Twenga|TwengaBot if you want to exclude them too)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz
@hans2103
hans2103 / default_login.php
Created June 30, 2016 13:16
return to the previous page after login. Template override com_users/login/default_login.php for Joomla!
<?php
if ($this->params->get('login_redirect_url'))
{
$login_redirect_url = $this->params->get('login_redirect_url', $this->form->getValue('return'));
}
else
{
$referer = htmlspecialchars($_SERVER['HTTP_REFERER']);
$uri = JUri::getInstance($referer);
$query = JFactory::getApplication()->getRouter()->parse($uri);
@hans2103
hans2103 / helper-unsetSqueezeBox.php
Created May 31, 2016 09:33
template function to remove SqueezeBox.
$helper = new ThisTemplateHelper();
$helper->unsetSqueezeBox();
class ThisTemplateHelper
{
public function __construct()
{
$this->doc = JFactory::getDocument();
}
@hans2103
hans2103 / font_grabber.rb
Created April 14, 2016 11:41 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
@hans2103
hans2103 / installm2db.sh
Created March 2, 2016 14:36 — forked from peterjaap/installm2db.sh
Install M2 database
bin/magento setup:install \
--base-url=http://mage2a.dev/ \
--db-host=localhost \
--db-name=mage2a \
--db-user=user \
--db-password=password \ # or leave this line out for dev
--admin-firstname=firstname \
--admin-lastname=lastname \
--admin-email=email@example.com \
--admin-user=username \
@hans2103
hans2103 / bash-export-delicious
Created February 20, 2016 13:36
command line - export Delicious Bookmarks
$ curl https://{username}:{password}@API.del.icio.us/v1/posts/all > bookmarks.xml