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 | |
//Examples of Using CDbCriteria | |
//Basic Usage | |
$Criteria = new CDbCriteria(); | |
$Criteria->condition = "price > 30"; | |
$Products = Product::model()->findAll($Criteria); | |
//OR |
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
-- Grant For Schema | |
GRANT ALL PRIVILEGES ON SCHEMA pdg TO project1; | |
-- Grant For Table | |
GRANT ALL PRIVILEGES ON TABLE pdg.proposal TO project1; | |
-- Grant For Sequence | |
GRANT USAGE, SELECT ON SEQUENCE pdg.proposal_id_seq TO project1; | |
-- Grant For View | |
GRANT SELECT ON pdg.vw_program_hierarchy TO project1; | |
-- //-- Source: http://www.postgresql.org/docs/8.3/static/sql-grant.html --// |
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 | |
/** | |
* Calculate a precise time difference. | |
* @param string $start result of microtime() | |
* @param string $end result of microtime(); if NULL/FALSE/0/'' then it's now | |
* @return flat difference in seconds, calculated with minimum precision loss | |
*/ | |
function microtime_diff($start, $end = null) { | |
if (!$end) $end = microtime(); |
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
-- Enable tablefunc | |
CREATE EXTENSION tablefunc; | |
-- Original Query Data | |
SELECT generate_series AS date, | |
b.desc AS TYPE, | |
(random() * 10000 + 1)::int AS val | |
FROM generate_series((now() - '100 days'::interval)::date, now()::date, '1 day'::interval), | |
(SELECT unnest(ARRAY['OSX', 'Windows', 'Linux']) AS DESC) b; |
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
// add this to your API controller in Yii | |
public function actionPreflight() { | |
$content_type = 'application/json'; | |
$status = 200; | |
// set the status | |
$status_header = 'HTTP/1.1 ' . $status . ' ' . $this->_getStatusCodeMessage($status); | |
header($status_header); | |
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 header('Access-Control-Allow-Origin: *'); ?> | |
{"berita":[ | |
<?php | |
$args = array( 'posts_per_page' => 5, 'offset'=> 0 ); | |
$myposts = get_posts( $args ); | |
$no=1; | |
foreach ( $myposts as $post ) : setup_postdata( $post ); ?> | |
{ | |
"judul": "<?php the_title(); ?>", | |
"gambar": "<?php if ( has_post_thumbnail() ) { |
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://support.google.com/mail/answer/7190?hl=en |
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
http://material-ui.com/ | |
https://www.muicss.com/ | |
http://materializecss.com/ | |
https://material.angularjs.org/ | |
http://googel.com/design/ | |
http://materialup.com/ | |
https://fezvrasta.github.io/bootstrap-material-design/ | |
http://www.getmdl.io/ |
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
http://blog.koonk.com/2015/07/46-useful-php-code-snippets-that-can-help-you-with-your-php-projects/ |
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://angularjs.zeef.com/gianluca.arbezzano |
OlderNewer