Skip to content

Instantly share code, notes, and snippets.

@rutger1140
rutger1140 / gform-reset.less
Last active July 4, 2016 17:27
Gravity Forms - basic style reset
// Simple form field styles
.form-field {
background-image: none;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
display: block;
padding: .5em 1em;
width: 100%;
}
@rutger1140
rutger1140 / SR.php
Last active July 4, 2016 17:28
WordPress 'search and replace' script from interconnectit.com
<?php
die("[!] Enable in code before use");
/**
*
* Safe Search and Replace on Database with Serialized Data v2.0.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
@rutger1140
rutger1140 / gist:10b9566d77e00293c935
Last active March 27, 2018 20:28
Javascript to toggle field visibility with radio or checkbox form element
$(function(){
var $togglefield = $("[data-toggle-field]");
$togglefield.on("change", function(){
var $this = $(this);
target = $this.data("toggle-field"),
action = $this.data("toggle-action") || 0,
show = false;
// We have a radio
if(action !== 0) {
@rutger1140
rutger1140 / gist:245caec13a9e8f8c5c3f
Created November 11, 2014 10:32
OSX create zip for release with excluded folders
zip -r release/v1.0.0-dev.zip . -x node_modules/\* -x bower_components/\* -x release/\* -x "*.git*" -x "*.DS_Store"
@rutger1140
rutger1140 / railscasts.tmTheme
Created November 4, 2014 14:01
Sublime Railscasts theme with GitGutter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@rutger1140
rutger1140 / gist:424698b9ad125997c812
Created October 31, 2014 09:14
Start project alias in bash file
alias startproject="git clone https://github.com/lekkerduidelijk/less-template.git . && npm install && bower install && grunt build && rm -rf .git/ && s source && grunt watch"
@rutger1140
rutger1140 / after.svg
Created October 23, 2014 08:37
Sketch SVG exportCompactSVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rutger1140
rutger1140 / Preferences.sublime-settings
Created October 15, 2014 08:22
Sublime preferences
{
"auto_indent": true,
"color_scheme": "Packages/Color Scheme - Default/Railscasts.tmTheme",
"default_line_ending": "unix",
"detect_indentation": false,
"draw_minimap_border": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "BitstreamVeraSansMono-Roman",
"font_size": 14.0,
@rutger1140
rutger1140 / .htaccess
Created October 8, 2014 15:30
Kirby CMS htaccess file - SEO optimized - 1000+ spam related IP blocks
# pass the default character set
AddDefaultCharset utf-8
php_flag short_open_tag on
ErrorDocument 404 /error
# Kirby .htaccess
# exclude panel from trailing slash removal
@rutger1140
rutger1140 / jail.local
Created October 2, 2014 13:48
Fail2Ban - block WordPress brute force hack attempts - Plesk 12
# Create a new jail via Plesk
# generated in /etc/fail2ban/jail.local
[wp-auth]
enabled = true
filter = wp-auth
action = iptables-multiport[name=NoAuthFailures, port="http,https"]
logpath = /var/www/vhosts/system/*/logs/*access*log
/var/log/httpd/*access_log
maxretry = 15