Skip to content

Instantly share code, notes, and snippets.

View rolandinsh's full-sized avatar
🧔
Remote developer (LEMP, Node.js, Neo4j [graph])

Rolands rolandinsh

🧔
Remote developer (LEMP, Node.js, Neo4j [graph])
View GitHub Profile
@rolandinsh
rolandinsh / gist:4b6cbfcb817de1dcc78c
Last active August 29, 2015 14:13
block visitors referred from semalt.com and buttons-for-website.com
# block visitors referred from semalt.com and buttons-for-website.com
RewriteEngine on
RewriteCond %{HTTP_REFERER} semalt\.com [NC]
RewriteRule .* - [F]
RewriteCond %{HTTP_REFERER} buttons\-for\-website\.com
RewriteRule ^.* - [F,L]
RewriteCond %{HTTP_REFERER} buttons\-for\-your\-website\.com
RewriteRule ^.* - [F,L]
@rolandinsh
rolandinsh / gist:52197d4d4feb37dffe9b
Last active August 29, 2015 14:19
block spam referers in NGINX. Can be used as global block for all sites; (used on my production server(s))
# Block semalt.com buttons-for-website.com buttons-for-your-website.com best-seo-offer.com 100dollars-seo.com semaltmedia.com as referral spam
# (c) 2015 Rolands Umbrovskis, http://umbrovskis.com
# if code above do not work:
if ($http_referer ~ "(semaltmedia\.com|100dollars-seo\.com|semalt\.com|buttons-for-website.com|buttons-for-your-website\.com|best-seo-offer\.com)") {
set $prohibited "1";
}
if ($prohibited) {
return 403;
@dave1010
dave1010 / gist:3135160
Created July 18, 2012 09:05
WordPress classes
$ ack --php 'class [\w]+'|grep -v '//'|grep -v '*'|grep -v '>'|sed 's/.*class //'|sed 's/ .*//'
WP_Widget
WP_Widget_Factory
WP_Embed
Moxiecode_JSONReader
Moxiecode_JSON
Moxiecode_Logger
GoogleSpell
PSpell
SpellChecker
@rolandinsh
rolandinsh / gist:3177639
Last active October 7, 2015 14:18
HTML5 MB
<!doctype html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta charset="utf-8">
<link rel="dns-prefetch" href="//s2.me2j.com" /><link rel="dns-prefetch" href="//i2.me2j.com" />
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
<title>Lapa</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<!--
All other head parts
-->
@rolandinsh
rolandinsh / gist:4270786
Created December 12, 2012 19:27
install a free startssl certificate in Plesk
in case it get lost http://www.jordicals.com/2010/04/how-to-install-a-free-startssl-certificate-in-plesk/
Here I leave you a trick about how to install a free startssl certificate in Plesk.
1 .- Validate in Plesk, go to the domain and then click to certificates.
2 .- Fill certificate data form (I recommend using 2048-bit), accept and send the request. This will generate the CSR key and private key.
3 .- Go to Startssl.com, make an account and go to the control panel. The first thing you must do is validate the corresponding domain at option validations option wizard -> domain name validation.
@rolandinsh
rolandinsh / WP-CLI-bash-update
Last active December 31, 2015 04:29
WP-CLI bash update
#!/bin/bash
declare -a wp_sites=('/var/www/pub/site1/' '/var/www/pub/site2/')
for site in "${wp_sites[@]}"; do
echo Upgrade in prograss for $site...
wp --path=$site db export $site/db-backup.sql
wp --path=$site core update
done
@blackhalt
blackhalt / opaaa.txt
Created December 3, 2016 18:33
Sandras Veinbergas Olugalvas 2016-12-03
@Ucibucis
@MikelisM
@baldone1000
@karlissilins
@Tornitis7
@Zile999
@MaraVilde
@IlvaKrampuza
@aaralds
@oposums
<?php
/*
Author: Hans2103
credit: Jim Westergren, Jeedo Aquino & Flynsarmy
File: index-with-redis.php
Updated: 2013-05-27
This is a redis caching system for Wordpress based on Redis connection using PHPRedis.
https://github.com/nicolasff/phpredis
@jakebellacera
jakebellacera / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Created September 21, 2010 23:39
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
# useful nginx configuration for reverse proxy with Apache
# edit lines 8, 11, and 30
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com)
server {
listen 80;
server_name domain.com *.domain.com; # edit this to your domain
@shivergard
shivergard / api.md
Last active February 26, 2018 21:45
API for Mobile Web apps

#exFoodyCheck API Documentation (for demo access and stuff please write some comment ;) )

Get Barcode Info

Returns json data about a single product.

  • URL

    /api/v1/get_barcode_info