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
// ========================================================================== | |
// Project: Schelp - mainPage | |
// Copyright: ©2009 My Company, Inc. | |
// ========================================================================== | |
/*globals Schelp */ | |
Schelp.mainPage = SC.Page.design({ | |
mainPane: SC.MainPane.design({ | |
childViews: 'middleView topView bottomView'.w(), |
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
{ | |
"auto_complete_delay": 50, | |
"auto_complete_selector": "source, text", | |
"auto_complete_size_limit": 4194304, | |
"auto_complete_with_fields": true, | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"drag_text": false, | |
"draw_indent_guides": true, | |
"draw_white_space": "all", |
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
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | |
/** | |
* CSS HELPERS | |
* | |
* Copyright (c) <2010> narvenblog.com | |
* | |
* | |
* @author Pedro Luz <[email protected]> | |
* @copyright 2007-2012 http://narvenblog.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
mysql --host={DB host} --user={user} --password={password} --quick -e {sql} | sed \'s/\t/","/g;s/^/"/;s/$/"/\' | gzip -9 -c > {file} |
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 | |
/* SELECT * FROM `hoge` `t` | |
---------------------------------------------------*/ | |
$c1 = new CDbCriteria(); | |
$m1 = Hoge::model()->findAll($c1); | |
/* SELECT * FROM `hoge` `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
<?php | |
// first approach | |
... | |
$criteria = new CDbCriteria; | |
$criteria->compare("price", 1); | |
$posts = Post::model()->find($criteria); | |
... | |
// second approach | |
... |
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
//needs jquery and jquery-ui | |
// auto complete | |
$( "#autocomplete-cities" ).autocomplete({ | |
source: function(request, response) { | |
//console.info(request, 'request'); | |
//console.info(response, 'response'); | |
$.ajax({ | |
//q: request.term, |
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 | |
/** | |
* Sort an array based on a given field key | |
* | |
* @param unknown_type $named_recs | |
* @param unknown_type $order_by | |
* @param unknown_type $rev | |
* @param unknown_type $flags | |
* @return unknown | |
*/ |
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
reset($array); | |
$first_key = key($array); | |
var_dump($array[$first_key])); |
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
// get highlight photo | |
$search = array_filter($user_photos, function($v) { | |
if ($v['highlight'] == 1) return $v; | |
}); |
OlderNewer