Skip to content

Instantly share code, notes, and snippets.

@jloescher
jloescher / wp-config.php
Last active August 29, 2015 14:04
Multi Environments | WP-Config.php
<?php
/** Absolute path to the WordPress directory. **/
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Define Environments **/
$environments = array(
'localhost' => 'localhost',
'development' => '',
@westc
westc / param-with-defaults.js
Created December 26, 2014 22:37
Parameterization of an object with the ability to set defaults.
function param(arrFields, callback) {
for (var t, o = {}, defaults = [], len = arrFields.length, i = len; i--;) {
t = o.toString.call(t = arrFields[i]) == '[object Array]' ? t : [t];
defaults[i] = t[1];
arrFields[i] = t[0];
}
return function(fields) {
for (var t, args = arrFields.slice.call(arguments, 0), i = len; i--;) {
args.unshift(fields && (o.hasOwnProperty.call(fields, t=arrFields[i]) ? fields[t] : defaults[i]));
@rmkane
rmkane / README.md
Last active August 29, 2015 14:13
A URL parser written in JavaScript

URL Parser

The following module handles parsing a URL in JavaScript. If this script is run outside of a browser, where the DOM is inaccessible, a regular expression will be executed to parse the provided URL.

Demo

[@JSFiddle][1]

Examples

@wycks
wycks / wp-config.php
Last active September 26, 2015 07:27
Multi Environment wp-config.php
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@lsauer
lsauer / jscopy.css
Created May 30, 2012 13:37
Copy to the clipboard in JavaScript, securely and without Flash
a{ cursor:pointer; }
a, a:link {
background-color: #eee; /*#407EC9*/
border-radius:5px;
padding:0px 2px 0px 2px;
color: #666;
font-weight: none;
text-decoration: none;
opacity:.7;
}
@jasonferrier
jasonferrier / wp-config.php
Last active October 10, 2015 03:27
Wordpress auto-config for dev/test/live environments
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@jcasabona
jcasabona / wordpress-ignore
Last active November 18, 2015 14:56
WordPress Complete .gitignore
## Start .gitignore
*.log
.htaccess
/index.php
license.txt
readme.html
sitemap.xml
sitemap.xml.gz
wp-activate.php
@simonpioli
simonpioli / wp-config.php
Created March 9, 2013 13:33
Improved Wordpress wp-config for >1 Environment
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@Brendonwbrown
Brendonwbrown / WP-config DB settings changer
Last active December 16, 2015 18:29
Update your WP-Config DB settings based on current environment.
# WP-Config File Changer
## Credit to Konstantin Kovshenin, a complete stranger who publishes nice things on the web.
### Nutshell: customize this code with various DB information and place it in wp-config.php file instead of corresponding config information. It instructs Wordpress to look for a different (empty) file in parent directory of local, development or production servers and serves up the appropriate config to wordpress.
### You will have to create empty env_local, env_development files in parent directories of your websites on corresponding servers.
<?php
if ( file_exists( dirname( __FILE__ ) . '/../env_local' ) ) {
// Local Environment