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 | |
$row = $this->article_model->get(2); | |
//stdClass Object ( [body] => Fuzzy Wuzzy was a bear; Fuzzy Wuzzy had no hair. Fuzzy Wuzzy wasn't very fuzzy, was he? [title] => Fuzzy Wuzzy [id] => 2 ) | |
//SELECT * FROM (`articles`) WHERE `id` = 2 | |
$row = $this->article_model->get_by('title', 'Fuzzy Wuzzy'); | |
//stdClass Object ( [body] => Fuzzy Wuzzy was a bear; Fuzzy Wuzzy had no hair. Fuzzy Wuzzy wasn't very fuzzy, was he? [title] => Fuzzy Wuzzy [id] => 2 ) | |
//SELECT * FROM (`articles`) WHERE `title` = 'Fuzzy Wuzzy' | |
// NOTE: if more than 1, returns first |
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
sudo chown -RL root:mysql /usr/local/mysql | |
sudo chown -RL mysql:mysql /usr/local/mysql/data | |
sudo /usr/local/mysql/support-files/mysql.server start |
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, configure, make and install International Components for Unicode | |
wget http://download.icu-project.org/files/icu4c/49.1/icu4c-49_1-src.tgz | |
tar xzvf icu4c-49_1-src.tgz | |
cd icu/source/ | |
./runConfigureICU MacOSX | |
make | |
sudo make install | |
# Install libjpeg support for GD | |
brew install jpeg |
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 | |
class CI_Date { | |
public $sec_in_min, $min_in_hour, $hr_in_day, $day_in_wk, $sec_in_wk, $sec_in_day, $min_in_wk, $min_in_day, $hr_in_wk; | |
public function __construct() { | |
$this->sec_in_min = 60; | |
$this->min_in_hr = 60; | |
$this->hr_in_day = 24; | |
$this->day_in_wk = 7; | |
$this->day_in_yr = 365; | |
$this->sec_in_hr = $this->sec_in_min * $this->min_in_hr; |
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
public function __call($method, $parameters) | |
{ | |
if (strpos($method, 'with_') === 0) | |
{ | |
$table = substr($method, 5); | |
return $this->with($table, $parameters[0]); | |
} | |
throw new \Exception("Method [$method] is not defined on the Model class."); | |
} |
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
HTML code: | |
<div id="myModal" class="modal hide fade"> | |
<div class="modal-header"> | |
<button class="close" data-dismiss="modal">×</button> | |
<h3>Title</h3> | |
</div> | |
<div class="modal-body"> | |
<div id="modalContent" style="display:none;"> |
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
https://speakerdeck.com/u/bastianhofmann/p/creating-scalable-web-applications | |
https://speakerdeck.com/u/kawanoshinobu/p/pyconjp-2012-try-sublime-text | |
https://speakerdeck.com/u/christoomey/p/deployment-on-the-cheap |
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
<snippet> | |
<content><![CDATA[ | |
// ${1} Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
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
<snippet> | |
<content><![CDATA[ | |
// ${1} Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)/edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
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
Thanks to: | |
http://realityloop.com/blog/2012/07/03/nginx-mariadb-php-aegir-mac-os-x-optional-drush-5-works-mountain-lion | |
and | |
http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion | |
--Fresh install Mountain Lion. | |
--Install XCode 4.4.2 | |
--Install Command line utilities via Xcode | |
--Install Homebrew |
OlderNewer