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
# brew install re2c graphviz | |
# cd /tmp | |
# wget http://pecl.php.net/get/xhprof-0.9.2.tgz | |
# tar -xvzf xhprof-0.9.2.tgz | |
# cd xhprof-0.9.2/extension | |
# phpize | |
# MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" | |
# export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET | |
# ./configure --with-php-config=/usr/local/zend/bin/php-config | |
# make |
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
diff --git markdown.php markdown.php | |
index ed79197..0cde939 100644 | |
--- markdown.php | |
+++ markdown.php | |
@@ -761,6 +761,17 @@ class Markdown_Parser { | |
$url = $this->encodeAttribute($url); | |
+ // For some links like [xxx](/node/xxx), turn them into absolute ones | |
+ // so when they're contained in feeds, the W3C feed validator won't |
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="formitem_school"> | |
<% if(schools && schools.length > 0) { | |
<option value="select_schools">Select School</option> | |
<% schools.each(function(t) { %> | |
<option value="<%= t.id %>" <% if(curSchool == t.id){ print('selected'); } %>><%= t.get("name") %></option> | |
<% }); | |
} else { %> | |
<option value"schools_none">No Schools</option> | |
<% } | |
</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
/*! | |
* Copyright (c) 2012 Eric Feminella, http://code.ericfeminella.com/license/LICENSE.txt | |
*/ | |
( function( _, Backbone ) | |
{ | |
// convenience reference to the Backbone.Collection constructor | |
var _initialize = Backbone.Collection.prototype.initialize; | |
/* | |
* The Backbone.PersistableCollection provides a simply abstraction which |
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
namespace.views.MyWizard = Backbone.Views.extend({ | |
initialize: function() { | |
_.bindAll(this, 'render', 'wizardMethod'); | |
} | |
render: function() { | |
this.wizardMethod(); | |
return this; | |
}, |
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
# Install Drush 5.4 | |
> cd /opt | |
> sudo git clone --recursive --branch master http://git.drupal.org/project/drush.git | |
> cd drush | |
> sudo git checkout tags/7.x-5.4 | |
> sudo ln -s /opt/drush/drush /usr/bin/drush | |
> sudo drush | |
> drush | |
> drush --version | |
drush version 5.4 |
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
# For Drupal 6: | |
## This sql will reset admin password to 'admin' | |
> UPDATE users SET pass = MD5('admin') WHERE uid=1; | |
# For Drupal 7: | |
## This drush command will reset admin password to 'admin' | |
> drush upwd admin --password=admin |
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
## Download a module and enable it, take 'migrate' module as an example: | |
> drush dl migrate --destination=sites/all/modules/contrib | |
> drush en migrate -y |
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
/** | |
* Round a number to a specified decimal place. | |
* @var num The number to be rounded | |
* @var digits The digit behind the decimal point to be rounded to | |
*/ | |
function roundNumber(num, digits) { | |
num = parserFloat(num); | |
var multiple = Math.pow(10, digits); | |
return Math.round(num * multiple) / multiple; |
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
#Suppose the Xcode (v4.3x) is installed at the default location, then: | |
## 1. Use this command to directly open it: | |
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
## 2. Create an alias for later quick access: | |
echo "alias ios-simulater='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'" >> ~/.bash_profile; source ~/.bash_profile |
OlderNewer