Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
zulhfreelancer / starts_with.md
Created November 17, 2016 07:34
Rails ActiveRecord: How to find all items that starts with something?
Model.where("table_column LIKE :prefix", prefix: "#{keyword}%")
@dvlop
dvlop / gist:fca36213ad6237891609e1e038a3bbc1
Last active July 21, 2024 21:22 — forked from allthingsdem/gist:63b3223a7d14ac1f2457
My long list of bad bots to block in htaccess, ready to copy and paste!
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot