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 | |
return array( | |
/* ... */ | |
'components' => array( | |
/* ... */ | |
'urlManager' => array( | |
'enablePrettyUrl' => true, | |
'rules' => require(__DIR__ . '/routes.php'), | |
), |
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 | |
CHtml::cssFile() => Html::cssFile() | |
CHtml::scriptFile() => Html::jsFile() | |
CHtml::link() => Html::a() | |
CHtml::image() => Html::img() | |
CHtml::submitButton() => Html::submitButton() | |
// View | |
$this->renderPartial() => $this->render() |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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
<!DOCTYPE html> | |
<html ng-app> | |
<head> | |
<title>Add / List Data (AngularJS)</title> | |
<style> | |
.list_data { margin-bottom: 2rem } | |
table, th, td { border: 1px solid #AAA } | |
th { cursor: pointer } | |
</style> | |
</head> |
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
.donslide { | |
display: table; | |
width: 100%; | |
} | |
.donslide .item { | |
display: table-cell; | |
width: 1%; | |
transition: 0.6s ease-in-out all; | |
overflow: hidden; | |
position: relative; |
OlderNewer