This file contains hidden or 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
| # browser compatibility config | |
| \Configure::write('Browser', array( | |
| 'minimum_requirement' => array( | |
| 'Chrome' => 36, | |
| 'Firefox' => 22, | |
| 'Safari' => 5, | |
| 'IE' => 9 | |
| ) |
This file contains hidden or 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
| #in your beforeFilter | |
| $this->Crud->on('afterSave', function(CakeEvent $event){ | |
| if($event->subject->success){ | |
| pr($event->subject->id); | |
| } | |
| }); |
This file contains hidden or 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
| 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 ) |
This file contains hidden or 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
| $ 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 |
This file contains hidden or 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
| SELECT salesperson_id, | |
| Sum(sold / salesperson_count) AS amount | |
| FROM project_items | |
| JOIN(SELECT allocation.project_item_id, | |
| sold, | |
| salesperson_id | |
| FROM project_item_sellers | |
| JOIN(SELECT project_item_id, | |
| Sum(amount) AS sold |
This file contains hidden or 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
| #antal dato | |
| ----------------- | |
| 75 8/9/2015 | |
| 69 1/9/2015 | |
| 63 26/5/2015 | |
| 62 9/6/2015 | |
| 54 15/9/2015 | |
| 51 19/5/2015 | |
| 42 12/5/2015 | |
| 41 16/6/2015 |
This file contains hidden or 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
| window.addEventListener('resize', throttle(resizer, 200)); | |
| function throttle(func, wait) { | |
| // from underscore.js | |
| var _now = Date.now || function() { return new Date().getTime(); }, | |
| context, args, result, timeout = null, previous = 0; | |
| var later = function() { | |
| previous = _now(); | |
| timeout = null; | |
| result = func.apply(context, args); |
This file contains hidden or 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 current = $('.mainNavTabs li.active a').attr('href').substr(1); | |
| if(current == 'nutrients'){ | |
| var rows = 'Type\tgram'; | |
| var cols = ['Fedt', 'Protein', 'Kulhydrat (tilgængelig)', 'Kostfibre']; | |
| $('tr.nutrient-row td').filter(function(){ | |
| return cols.indexOf($(this).text()) != -1; | |
| }).each(function(){ | |
| var self = $(this); | |
| var name = self.text(); |
This file contains hidden or 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 draw = function(cities){ | |
| var width = $(".linechart svg"); | |
| var svg = d3.select(".linechart svg"); | |
| var width = svg.node().width.baseVal.value; | |
| var height = svg.node().height.baseVal.value; | |
| var margin = {top: 20, right: 80, bottom: 30, left: 50}, | |
| width = width - margin.left - margin.right, | |
| height = height - margin.top - margin.bottom, |
This file contains hidden or 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 draw_table = function(data, caption){ | |
| var table = d3.select(".data-table").append("table"); | |
| var tbody = table.append("tbody"); | |
| var trows = tbody | |
| .selectAll("tr") | |
| .data(data) | |
| .enter() | |
| .append("tr"); |