This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def valid_json_only(json_string) | |
begin | |
return false unless json_string.is_a?(String) | |
JSON.parse(json_string) | |
rescue JSON::ParserError | |
false | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rb_temp_public_preview_fix() { | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
'use strict'; | |
var ppFix | |
, $field | |
, q | |
, postId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def suffix_filename(filename, suffix) | |
extension = File.extname(filename) | |
filename.reverse.sub(extension.reverse, ("#{suffix}#{extension}").reverse).reverse | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(str) { | |
return str | |
.toLowerCase() | |
.replace(/[^\w ]+/g,'') | |
.replace(/ +/g,'-') | |
; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global _gaq */ | |
(function ($) { | |
'use strict'; | |
if ( typeof(_gaq) === 'undefined' ) { | |
return false; | |
} | |
var $forms | |
, slugify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global Modernizr */ | |
var fixNoBackgroundSize = function () { | |
var bg2img | |
; | |
bg2img = function ($el) { | |
var bg | |
, classes | |
, $r | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg.switch2inline = function () { | |
var switcher | |
; | |
switcher = function ($el) { | |
var src | |
, classes | |
, $replacement | |
, guid | |
, s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/fail2ban/jail.conf | |
[wordpress] | |
enabled = true | |
port = http,https | |
filter = wordpress-auth | |
logpath = /var/log/nginx/access.log | |
maxretry = 3 | |
bantime = 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getPagesSegment | |
; | |
(function(){ | |
'use strict'; | |
var get | |
; | |
get = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = "/srv/app" | |
environment "production" | |
workers 1 | |
threads 0,8 | |
bind "unix://#{path}/current/tmp/sockets/puma.sock" | |
pidfile "#{path}/current/tmp/pids/puma.pid" | |
state_path "#{path}/current/tmp/states/puma.state" | |
stdout_redirect "#{path}/current/log/stdout", "#{path}/current/log/stderr" |