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
Various handy bits and bobs relating to SQL (and the mySQL RDBMS in particular). | |
# Dump all databases from CLI: | |
$ mysqldump -h [server] -u root --password=password --default-character-set=utf8 --set-charset --all-databases > all_dbs.sql | |
# Restore all databases from CLI: | |
$ mysql -u root --password=password --default-character-set=utf8 --set-charset < all_dbs.sql |
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
Show hidden characters
{ | |
"": "", | |
"auto_complete_commit_on_tab": true, | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": false, | |
"font_face": "Consolas", | |
"font_options": |
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
<select name="playa_field[selections][]"> | |
{exp:channel:entries dynamic="no" channel="my_channel"} | |
<option name="{entry_id}">{title}</option> | |
{/exp:channel:entries} | |
</select> |
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
// Some references here: http://bitly.com/bundles/adrienne/15 | |
// Using native getElementByID to create a jQuery collection is faster than jQuery's ID selector! | |
// ------------------------------------------------------------------------------------------------------------- | |
// prefer: | |
$(document.getElementById("testid")); | |
// to: | |
$("#testid"); |
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
# ---------------------------------------------------------------------- | |
# 5G BLACKLIST/FIREWALL (2013) | |
# @ http://perishablepress.com/5g-blacklist-2013/ | |
# ---------------------------------------------------------------------- | |
# ---------------------------------------------------------------------- | |
# 5G:[QUERY STRINGS] | |
# ---------------------------------------------------------------------- | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
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
<?xml version="1.0" encoding="{charset}"?> | |
<rss version="2.0" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" | |
xmlns:admin="http://webns.net/mvcb/" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
xmlns:atom="http://www.w3.org/2005/Atom" | |
xmlns:ee="http://ellislab.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
Paste this into the console in your browser: | |
$.post("https://github.com/users/follow?target=organizationName"); |
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
{!-- putting the items in lists --} | |
{exp:channel:entries channel="clinical_trials" orderby="ct_last_updated" sort="desc" status="not Closed"} | |
{exp:stash:append_list name='ct_recruitment_list'} | |
{stash:listitem} | |
{ct_recruitment} | |
{/stash:listitem} | |
{/exp:stash:append_list} | |
{exp:stash:append_list name='ct_agegroups_list'} | |
{stash:listitem} | |
{ct_age_groups:ct_age_group} |
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
SELECT | |
ia.descriptor_id, descriptor_name, | |
MAX(pkg_override_id) AS pkg_id, MAX(version_type_id) AS version, | |
CASE WHEN MAX(version_type_id) > 1 THEN 1 ELSE 0 END AS overridden, | |
CONCAT('[', | |
SUBSTRING_INDEX( | |
GROUP_CONCAT( | |
CASE | |
WHEN cat_override_id IS NOT NULL AND cat_override_id > 0 | |
THEN CONCAT('{"',ia.item_id,'" : [ {"iname" : "',item_name,'"} , {"icat" : "', |
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 | |
/** | |
* Modifying the final CP Output | |
* | |
* This extension demonstrates how you can access and modify the final ExpressionEngine | |
* CP output. It is not a hack, but it is a new technique that to my knowledge has not | |
* been used before in an EE addon. | |
* | |
* This has not been road tested and its side effects are unknown, so use this at your own risk. |