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
<div id="demo"> | |
<h1>{{bob.fields.firstName}} {{bob.fields.lastName}}</h1> | |
</div> | |
<ul id="humans-list"> | |
<li v-repeat="humans"> | |
{{fields.firstName}} {{fields.lastName}} | |
</li> | |
</ul> |
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
/** | |
* Show Me the Evens - Show me the Odds | |
* Diana is learning to count and she just learned the difference between odds and even numbers. | |
* She wants to have some fun, so she picks a random number. | |
* If that number is even, she decides to count all the even numbers up to it starting from 0 up to (but not including) the input. | |
* If not, she decides to count all the odd numbers up to that number starting from 1 (but not including) the input. | |
**/ | |
const | |
range = x => y => |
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
/** | |
* Show Me the Evens - Show me the Odds | |
* Diana is learning to count and she just learned the difference between odds and even numbers. | |
* She wants to have some fun, so she picks a random number. | |
* If that number is even, she decides to count all the even numbers up to it starting from 0 up to (but not including) the input. | |
* If not, she decides to count all the odd numbers up to that number starting from 1 (but not including) the input. | |
**/ | |
const counting = (x) => { | |
return arrayFrom(x) |
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
/** | |
* By Rogério M. de Queiroz(rogerio.mq@gmail.com) | |
* https://github.com/rogeriomq | |
* Funções de filtros diversos. | |
* Código inspirado nos .js de igorcosta/ng-filters-br: | |
* https://github.com/igorcosta/ng-filters-br/tree/master/src/brasil/filters | |
*/ | |
const cpfFormatter = (input) => { | |
let str = input + '' |
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 | |
final class DiggStylePagination { | |
/** | |
* DiggStylePagination::create(5, 1, 15, function($page){ return 'http://localhost/' . $page; }) | |
* | |
* | |
*/ | |
public final static function create($currentPage, $firstPage, $totalPages, \Closure $url, $adjacents = 1, array $classes = []) { |
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 | |
# Include this file in your functions.php | |
add_shortcode('human-name', 'human_name'); | |
add_shortcode('human_name', 'human_name'); | |
add_shortcode('name', 'human_name'); | |
function human_name($atts, $content = null) { | |
return HumanName::parse($content); |
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
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
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
function formatTime (timeInMs) { | |
let date = new Date(timeInMs) | |
// ${date.getDate()}/${date.getMonth()}/${date.getFullYear()} | |
return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}.${date.getMilliseconds()}` | |
} | |
function log (type, ...args) { | |
if (this.$options.debug) { | |
console[type](`%c[${this.$_id}]${formatTime(Date.now())}>> `, | |
`background:${type === 'log' ? '#384A5E' : type === 'warn' ? '#F1BF39' : '#FF5370'}; padding: 3px; border-radius: 3px; color: #fff`, |
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 prefix = process.env.PREFIX | |
const nodeEnv = process.env.NODE_ENV | |
let logCounter = 0 | |
let errorCounter = 0 | |
let fatalCounter = 0 | |
let warnCounter = 0 | |
export const vLogger = { | |
install (Vue, options) { |
OlderNewer