Skip to content

Instantly share code, notes, and snippets.

function barley_check_conditions() {
global $current_user, $post;
if ( isset($_GET['barley_editor']) && $_GET['barley_editor'] == 'off' )
return false;
if ( (is_single() || is_page()) && (is_main_query()) && (in_the_loop()) ) {
if ( current_user_can( 'edit_others_posts' ) || ($post->post_author == $current_user->ID) ) {
return true;
/*Barley Overrides*/
if ( !isset($_GET['barley_editor']) || $_GET['barley_editor'] !== 'on' )
$_GET['barley_editor'] = 'off';
remove_filter('edit_post_link', 'barley_custom_edit_post_link');
// Change "Edit" to "Edit Advanced Options" when template uses edit_post_link
function indyhall_barley_custom_edit_post_link($output) {
if ( is_single() || is_page() ) { // Only replace this link on single or pages
$output = str_replace('Edit', 'Edit Advanced Options', $output);
/*Barley Overrides*/
if ( !isset($_GET['barley_editor']) || $_GET['barley_editor'] !== 'on' )
$_GET['barley_editor'] = 'off';
remove_filter('edit_post_link', 'barley_custom_edit_post_link');
// Change "Edit" to "Edit Advanced Options" when template uses edit_post_link
function indyhall_barley_custom_edit_post_link($output) {
if ( is_single() || is_page() ) { // Only replace this link on single or pages
$output = str_replace('Edit', 'Edit Advanced Options', $output);
At this point, you might say I'm a habitual launcher. That's right, "shipping stuff" is habit forming behavior.
It wasn't always this way, of course. My work ethic usually involved procrastination...not because I was lazy, but because I thought I worked best under pressure.
What I found out was that I was more interested in the act of completion, the act of achieving. That resulted in the process of getting there feeling painful for me, and became something I wanted to avoid.
It was when I got more comfortable zooming out from the BIG launch, and realizing that there were lots of little milestones along the way, I was able to change my perspective. If I did this right, I could launch something almost every day...or at least every week or two...and all of those little launches would add up to my larger launch goal.
With IndyHall, for example, my goal was initially very simple and self-serving: I wanted it to be easier to find other people to collaborate with, and I DIDN'T want to have to leave Philadelp
#!/usr/bin/env ruby
# Dropzone Destination Info
# Name: GitHub Gist
# Description: Drag text to share it instantly via GitHub Gist. Hold down option to make a public Gist. Click to copy and goto the last URL.
# Handles: NSStringPboardType
# Events: Clicked, Dragged
# KeyModifiers: Option
# Creator: Edgar Suarez
# URL: http://e.dgar.org
awk '{
if ($0 in stored_lines)
x=1
else
print
stored_lines[$0]=1
}' colors.txt > colors.clean.txt
2010-09-21T20:24:20+00:00 ERR (3):
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6622-0-1' for key 'PRIMARY'' in /var/www/pwi/site/app/code/local/Zend/Db/Statement/Pdo.php:243
Stack trace:
#0 /var/www/pwi/site/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/pwi/site/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /var/www/pwi/site/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#3 /var/www/pwi/site/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#4 /var/www/pwi/site/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php(516): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#5 /var/www/pwi/site/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php(135): Mage_Catalog_Model_Resource_Eav
es account prob
This playlist is a tribute to some of the best karaoke songs I’ve sang or seen sung. This clearly doesn’t cover all of the best tracks, but I also had to account for the fact that this was supposed to be a playlist. In my mind, a playlist tells a story, and that arc in this case is the story of a totally epic party night in your favorite karaoke bar. These songs are chosen for personal preference, as well as crowd-please-ability and placement in the night. Along with each track is some commentary, suggestions, and even a rating scale of difficulty, how likely people are to sing along, and how likely you are to dance. All ratings are on a scale of 1-5, 1 being the least and 5 being the most.
Are you brave enough to step up to the mic and take this trip with me? Here we go!
Faith – George Michael
One of the cardinal rules of karaoke is not to start too early in the night. That said, sometimes you need to be the first singer to break the ice and it’s critical to have a solid warm-up song. This song needs to se