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
# Changing the main site url and home url locations for Wordpress via SQL | |
# Useful when migrating database across environments | |
update wp_options set option_value = 'new_url' where option_name IN ('siteurl', 'home'); |
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
// 1. Enter sheet name where data is to be written below | |
var SHEET_NAME = "Sheet Name"; | |
// 2. Run > setup | |
// | |
// 3. Publish > Deploy as web app | |
// - enter Project Version name and click 'Save New Version' | |
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously) | |
// | |
// 4. Copy the 'Current web app URL' and post this in your form/script action |
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
getInternetExplorerVersion: function(){ | |
// Returns the version of Internet Explorer or a -1 | |
// (indicating the use of another browser). | |
var rv = -1; // Return value assumes failure. | |
if (navigator.appName == 'Microsoft Internet Explorer') | |
{ | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) | |
rv = parseFloat( RegExp.$1 ); |
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
// Shift the page to a div. Replace 'target' with a jquery selector query. | |
$('html,body').animate({ | |
scrollTop: $(target).offset().top | |
}, 1000); | |
// Shift a div to your current browser window location - Replace 'target' with a jquery selector query. | |
$(target).animate({ | |
top: $(document).scrollTop() | |
}, 800); |
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 | |
include 'remove-comments.php' |
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
module.exports = function (grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
browserify : { | |
app : { | |
files : { | |
'dist/app.js' : ['scripts/app.js'] | |
} |
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
-- Run as: | |
-- mysql -uusername -p < change_multisite_url.sql | |
-- Set the db name, old site domain, and new site domain | |
use 'db_name'; | |
SET @old_site = 'old_domain.com'; | |
SET @site = 'new_domain.com'; |
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 | |
// For some reason, when you embed a google calendar, the colors they | |
// display as background colors for the calendars don't fully match the colors | |
// that are in the embed code. This is a map from the hexadecimal color codes that | |
// are in the embed code to what they really render as in the embed | |
// This will help if you're building a custom legend, for example | |
$color_map = 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
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var uglify = require('gulp-uglify'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var livereload = require('gulp-livereload'); |