Skip to content

Instantly share code, notes, and snippets.

@codeablehq
codeablehq / domain.com.conf
Created December 28, 2014 12:54
Optimized Nginx settings for WP
server {
server_name domain.com;
listen 443 ssl spdy;
root /home/webmaster/www/domain.com;
index index.php index.html;
# SSL configuration
ssl_certificate /home/webmaster/certs/domain.com.crt;
ssl_certificate_key /home/webmaster/certs/domain.com.key;
@codeablehq
codeablehq / www.wp-kickstart.com.conf
Last active August 29, 2015 14:12
WP-Kickstart Nginx configuration
server {
server_name www.wp-kickstart.com;
listen 443 ssl spdy;
# SSL configuration
ssl_certificate /home/webmaster/certs/wp-kickstart.com.crt;
ssl_certificate_key /home/webmaster/certs/wp-kickstart.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
ssl_prefer_serve
@codeablehq
codeablehq / backup.sh
Last active July 3, 2017 07:07
A script that creates a backup of your WordPress site and uploads it to Dropbox
#!/bin/bash
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh
# make it executable: chmod +x /usr/local/sbin/backup.sh
# then add it to cron: crontab -e
# and add the line below, which will run backup 3am each day, then upload to Dropbox
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1
# You also need WP CLI installed: http://wp-cli.org/
@codeablehq
codeablehq / cached-bundle
Created May 7, 2014 17:33
Speed up Travis builds by reusing gem bundle
#!/usr/bin/env bash
# Usage: script/cached-bundle install --deployment
#
# After running `bundle`, caches the `vendor/bundle` directory to S3.
# On the next run, restores the cached directory before running `bundle`.
# When `Gemfile.lock` changes, the cache gets rebuilt.
#
# Requirements:
# - Gemfile.lock
# - TRAVIS_REPO_SLUG
describe('Controller: SignInCtrl', function () {
var ctrl = null, scope;
beforeEach(module('Codeable'));
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('SignInCtrl', {$scope: scope});
}));
def rename_keys(obj)
if obj.is_a? Hash
Hash[rename_hash_keys(obj)]
elsif obj.is_a? Array
obj.map {|o| rename_keys(o)}
end
end
def rename_hash_keys(hash)
p hash