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
function frequency(array_elements){ | |
return array_elements.sort().reduce((b,c)=>((b[b.findIndex(d=>d[0]===c)]||b[b.push([c,0])-1])[1]++,b),[]); | |
} |
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
/* | |
* @param1 = string | |
* return boolean | |
*/ | |
function isUniqueCharater(str){ | |
return str.length === new Set(str).size; | |
} |
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
function frequency(array_elements) { | |
array_elements.sort(); | |
var current = null; | |
var cnt = 0; | |
var result = []; | |
for (var i = 0; i < array_elements.length; i++) { | |
if (array_elements[i] != current) { | |
if (cnt > 0) { | |
result.push([current, cnt]); |
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 observeDOM = (function(){ | |
var MutationObserver = window.MutationObserver || | |
window.WebKitMutationObserver; | |
return function(obj, thistime, callback){ | |
if(typeof obj === 'undefined'){ | |
console.log('obj is undefined'); | |
return; | |
} |
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
function getVar($var){ | |
return isset($_GET[$var]) ? $_GET[$var] : 0; | |
} | |
function getReportSetting($var){ | |
global $reportSetting; | |
return isset($reportSetting[$var]) ? $reportSetting[$var] : 0; | |
} | |
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
# Template for a VirtualHost with SSL | |
# Note: to use the template, rename it to /etc/apache2/vhost.d/yourvhost.conf. | |
# Files must have the .conf suffix to be loaded. | |
# | |
# See /usr/share/doc/packages/apache2/README.QUICKSTART for further hints | |
# about virtual hosts. | |
# NameVirtualHost statements should be added to /etc/apache2/listen.conf. | |
# |
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
<?php | |
/** | |
* This is a implementantion in PHP of primary application logic for our Functional Programming blog example | |
* See related blog series at: https://masterfermin02.wordpress.com/tag/functional-programming/ | |
* Version: 1.0 | |
*/ | |
// Access the `obj` using the property `prop` | |
function get_prop($obj, $prop) | |
{ | |
if ( is_callable( $prop ) ) { |
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
<?php | |
/** | |
* This is a implementantion in PHP of primary application logic for our Functional Programming blog example | |
* See related blog series at: http://www.datchley.name/tag/functional-programming/ | |
* Version: 2.0 | |
*/ | |
// Access the `obj` using the property `prop` | |
function get_prop($obj, $prop) | |
{ | |
if ( is_callable( $prop ) ) { |
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
/** | |
* Primary application logic for our Functional Programming blog example | |
* See related blog series at: http://www.datchley.name/tag/functional-programming/ | |
* Version: 2.0 | |
*/ | |
// A simple, resuable comparison for '>=' | |
function greaterThanOrEqual(a, b) { | |
return a >= b | |
} |
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
<?php | |
$data = json_decode('[ | |
{ | |
"id": 1, | |
"value1": 5, | |
"value2": 10 | |
}, | |
{ |