Skip to content

Instantly share code, notes, and snippets.

View said-and-done's full-sized avatar

Said Nuh said-and-done

  • @tv2 Editorial Dev Team
  • Copenhagen, Denmark
View GitHub Profile
@said-and-done
said-and-done / gist:9805586
Created March 27, 2014 11:33
compression ratio of JSON output: 95%
$ curl -s "https://codan.local../api/filtered.json" | gzip -> out.json; gzip --list out.json
compressed uncompressed ratio uncompressed_name
17.9 KB 381.4 KB 95.3% out.json
SELECT `Salesperson`.`id`,
`Salesperson`.`company_id`,
(SELECT Sum(project_item_allocations.amount /
project_items.salesperson_count)
FROM project_item_allocations
JOIN project_item_sellers
ON ( project_item_allocations.project_item_id =
project_item_sellers.project_item_id )
JOIN project_items
ON ( project_items.id = project_item_sellers.project_item_id )
#in your beforeFilter
$this->Crud->on('afterSave', function(CakeEvent $event){
if($event->subject->success){
pr($event->subject->id);
}
});
# browser compatibility config
\Configure::write('Browser', array(
'minimum_requirement' => array(
'Chrome' => 36,
'Firefox' => 22,
'Safari' => 5,
'IE' => 9
)
if (!window.console) {
window.console = {};
var methods = ['log', 'debug', 'info', 'error'], count = methods.length;
while (count--)
window.console[methods[count]] = function () {};
}
# create a test branch under github:export
# https://github.com/nodesagency/cakephp-export
> cd htdocs/app/Plugin/Export
> git co -b a-test-branch
> git push -u origin a-test-branch
#create a test branch under github:export
> cd htdocs/app/Plugin/Export
> git co -b a-test-branch
> git push -u origin a-test-branch
#create a test branch under github:export
> cd htdocs/app/Plugin/Export
> git co -b a-test-branch
> git push -u origin a-test-branch
@said-and-done
said-and-done / gist:8349197
Created January 10, 2014 09:41
Create a dummy branch under github:export
> cd htdocs/app/Plugin/Export
> git co -b a-test-branch
> git push -u origin a-test-branch
> cd htdocs/app/Plugin/Export
> git co -b a-test-branch
> git push -u origin a-test-branch