http://guides.rubyonrails.org/association_basics.html
- belongs_to : TABLE_NAME
- has_one : TABLE_NAME [:through => :TABLE_NAME]
- has_many : TABLE_NAME [:through => :TABLE_NAME]
- has_and_belongs_to_many : TABLE_NAME [:join_table => :TABLE_NAME]
<?php | |
/** Absolute path to the WordPress directory. */ | |
if ( !defined('ABSPATH') ) | |
define('ABSPATH', dirname(__FILE__) . '/'); | |
/** Load configuration based on the server's environment **/ | |
$env = isset($_SERVER['ENVIRONMENT']) ? $_SERVER['ENVIRONMENT'] : 'dev'; | |
require_once ABSPATH . 'wp-config/wp-config.' . strtolower($env) . '.php'; | |
/** Sets up WordPress vars and included files. */ |
<?php | |
/** | |
* Define type of server | |
* | |
* Depending on the type other stuff can be configured | |
* Note: Define them all, don't skip one if other is already defined | |
*/ | |
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use |
<?php | |
/** | |
* WordPress config file to use one directory above WordPress root, when awesome version of wp-config.php is in use. | |
* | |
* Awesome wp-config.php file - https://gist.github.com/1923821 | |
*/ | |
/* WordPress Local Environment DB credentials */ |
function htmlreplace(a, b, element) { | |
if (!element) element = document.body; | |
var nodes = element.childNodes; | |
for (var n=0; n<nodes.length; n++) { | |
// MSIE doesn't have Node | |
if (nodes[n].nodeType == 3) { | |
var r = new RegExp(a, 'gi'); | |
// MSIE8 and less doesn't have textContent | |
if (nodes[n].textContent) { |
# https://github.com/matplotlib/matplotlib/issues/881 | |
# Several of the ColorBrewer maps are "qualitative", meaning | |
# they are just a group of colors that can be used together | |
# for categories of data. So I remapped Accent to segments | |
# instead of continuous: | |
# Actually, these should be used with ListedColormap, and | |
# the number of colors should depend on the number of | |
# categories in the data, with colors removed from the | |
# list in a certain order? |
@Brett's searches | |
@Brett's custom searches | |
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo) | |
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo) | |
grep https://www.cueup.com/?q=%s&fq=1 Greplin | |
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo) | |
bt https://duckduckgo.com/site:brettterpstra.com%20%s BrettTerpstra.com (DuckDuckGo) | |
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything) | |
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints | |
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software) |
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; | |
} |
http://guides.rubyonrails.org/association_basics.html
/* | |
Copyright (c) 2017 Chris Patuzzo | |
https://twitter.com/chrispatuzzo | |
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 the following conditions: |
<?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 |