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
project | |
src | |
coffee | |
foo.coffee | |
component | |
bar.coffee | |
animals | |
dog.coffee | |
cat.coffee | |
public |
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 | |
namespace App\Models\Traits; | |
use \Validator; | |
trait ValidateModelTrait | |
{ | |
private $errors; | |
private $objValidator; |
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
/** | |
* Based on the mysql cluster | |
* @link http://jonisalonen.com/2012/k-means-clustering-in-mysql/ | |
*/ | |
-- SELECT | |
-- * FROM | |
-- unnest(kmeans(array(SELECT | |
-- ( | |
-- lat, |
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
/* | |
-- EXAMPLE -- | |
SELECT | |
* FROM | |
unnest(grid(array(SELECT | |
( | |
lat, |
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
echo '{"doNotReplaceKey":"bábögêjírù","replaceValueKey":"bábögêjírù"}' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[áâàãä]/replaceValueKey":"\1a/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[éêèë]/replaceValueKey":"\1e/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[íîìï]/replaceValueKey":"\1i/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[óôòõö]/replaceValueKey":"\1o/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[úûùü]/replaceValueKey":"\1u/g;ta' | |
# result: | |
# {"doNotReplaceKey":"bábögêjírù","replaceValueKey":"babogejiru"} |
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
# What is this? | |
Many R functions have a nice printable version that is accessible throw the print function. | |
But, when we want to get this content and using it to print inside of the HTML or PDF document, the result is not good. | |
This function helps to get the printable content into a varible. | |
## The Function | |
```{r tidy_print_function} | |
library(stringr) |
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
const exec = require('child_process').exec; | |
var letters = " abcdefghijklmnopqrstuvxz".split(""); | |
var args = process.argv.slice(2); | |
function number_to_word(number) { | |
let result = ""; | |
while (number > 0 ) { | |
let pos = number % letters.length; | |
let char = letters[ pos ]; |
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
// Invoked child machine | |
const counterMachine = Machine({ | |
id: 'counter', | |
initial: 'active', | |
context:{ | |
current: 0, | |
times: 0, | |
timesLimit: 5, |