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
server { | |
include /home/webmaster/www/codeable.io.conf; | |
server_name codeable.io; | |
listen 443 ssl spdy default_server; | |
root /home/webmaster/www/codeable.io; | |
index index.php index.html; | |
error_log /var/log/nginx/codeable.io.error.log warn; |
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 register_watermarked_size() { | |
add_image_size( 'watermarked', 550, 550, true ); // This is what should be uploaded | |
} | |
add_action( 'init', 'register_watermarked_size' ); | |
class Watermark_Image { | |
// The attachment meta array | |
public $meta = array(); |
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
import superagent from 'superagent'; | |
import { merge } from 'lodash'; | |
import { camelizeKeys, decamelizeKeys } from 'humps'; | |
import config from 'config'; | |
const CALL_API = Symbol.for('Call API'); | |
export const GENERIC_ERROR = 'GENERIC_ERROR'; | |
const genericErrors = { | |
400: 'You\'ve attempted to make a request the server didn\'t expect', |
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
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
labels: | |
name: etcd | |
name: etcd | |
spec: | |
template: | |
metadata: | |
labels: |
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
<?php | |
// Don't include the opening tag | |
function html5_insert_image( $html, $id, $caption, $title, $align, $url, $size, $alt ) { | |
$src = wp_get_attachment_image_src( $id, $size, false ); | |
$html5 = "<figure id=\"post-$id media-$id\" class=\"align-$align\">"; | |
if ( $url ) { | |
$html5 .= "<a href=\"$url\" class=\"image-link\"><img src=\"$src[0]\" alt=\"$alt\" /></a>"; | |
} else { |
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 myWidgets = myWidgets || {}; | |
// Model for a single testimonial | |
myWidgets.Testimonial = Backbone.Model.extend({ | |
defaults: { 'quote': '', 'author': '' } | |
}); | |
// Single view, responsible for rendering and manipulation of each single testimonial | |
myWidgets.TestimonialView = Backbone.View.extend( { |
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
<?php | |
class acf_field_gravity_forms extends acf_field { | |
function __construct() { | |
$this->name = 'gravity_forms_field'; | |
$this->label = __( 'Gravity Forms', 'acf' ); | |
$this->category = __( "Relational", 'acf'); | |
$this->defaults = array( | |
'multiple' => 0, |
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
kind: Endpoints | |
apiVersion: v1 | |
metadata: | |
name: glusterfs | |
subsets: | |
- addresses: | |
# Change the following to match your GlusterFS instance IPs | |
- ip: 10.132.0.5 | |
- ip: 10.132.0.6 | |
ports: |
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
import fs from 'fs'; | |
import path, { resolve } from 'path'; | |
import assert from 'assert'; | |
import Module from 'module'; | |
import jsdom from 'jsdom'; | |
import Mocha from 'mocha'; | |
import chokidar from 'chokidar'; | |
// Let's import and globalize testing tools so | |
// there's no need to require them in each test |
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
# This file should be in /etc/monit/conf.d | |
check process hhvm with pidfile /var/run/hhvm/pid | |
group hhvm | |
# Start program calls our custom script from above | |
start program = "/usr/local/sbin/start_hhvm.sh" | |
stop program = "/usr/sbin/service hhvm stop" | |
if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
if mem > 400.0 MB for 1 cycles then restart | |
if 5 restarts with 5 cycles then timeout |