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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
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 code is released under the MIT license. | |
Copyright (C) 2012 Matt Magoffin | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to |
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
// Replace 7 with the ID of your form and 13 with the ID of the field you want to force "all required" | |
// http://www.gravityhelp.com/documentation/page/Gform_field_validation | |
add_filter("gform_field_validation_7_13", 'validate_tcs', 10, 4); | |
function validate_tcs($result, $value, $form, $field) { | |
// Convert the checkbox input name value (returned as part of "field") | |
// into the "underscored" ID version which is found in the $_POST | |
foreach ($field['inputs'] as $input) { | |
$input_post_value = 'input_' . str_replace('.', '_', $input['id']); | |
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
// Support routines for automatically reporting user timing for common analytics platforms | |
// Currently supports Google Analytics, Boomerang and SOASTA mPulse | |
// In the case of boomerang, you will need to map the event names you want reported | |
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable: | |
// rumMapping = {'aft': 'custom0'}; | |
(function() { | |
var wtt = function(n, t, b) { | |
t = Math.round(t); | |
if (t >= 0 && t < 3600000) { | |
// Google Analytics |
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 | |
/** | |
* Plugin Name: MU plugins subdirectory loader | |
* Plugin URI: https://gist.github.com/lavoiesl/6302907 | |
* Description: Enables the loading of plugins sitting in mu-plugins (as folders) | |
* Version: 0.1 | |
* Author: github@lavoie.sl | |
* Author URI: http://blog.lavoie.sl/ | |
* |
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 | |
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
if (!isset($_POST['source']) || !isset($_POST['target'])) { | |
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); | |
exit; | |
} |
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
add_action('gform_after_submission', 'gform_synchronise_media_library', 10, 2); | |
function gform_synchronise_media_library($entry, $form) { | |
if(!function_exists('wp_generate_attachment_metadata')){require_once(ABSPATH . 'wp-admin/includes/image.php');} | |
$post_id = $entry['post_id']; | |
$fileupload_fields = GFCommon::get_fields_by_type($form, array("fileupload")); | |
foreach($fileupload_fields as $field){ | |
$field_id = $field["id"]; | |
$file_url = $entry["$field_id"]; | |
if (isset($_FILES['input_' .$field_id]) && $file_url != '' && $file_url !=null){ |
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
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
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 | |
function twitter_metadata($metadata) { | |
$metadata['twitter:card'] = 'summary'; | |
$metadata['twitter:creator'] = '@willnorris'; | |
foreach (array('url', 'title', 'description', 'image') as $attr) { | |
if (array_key_exists("og:$attr", $metadata)) { | |
$metadata["twitter:$attr"] = $metadata["og:$attr"]; | |
} |
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
# Install on ubuntu trusty tahr 14.04 | |
# I do this with root user, but if you sudo access with your user it will work too! | |
sudo su | |
# Update apt-get | |
apt-get update | |
# Install java jdk 7 or java jdk 8 or oracle jdk | |
apt-get install openjdk-7-jre-headless | |
# Make sure java is installed | |
java -version | |
# This should output: java version "1.7.XX" |
OlderNewer