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
create index on :Country(name); | |
create index on :City(name); | |
create index on :Sport(name); | |
create index on :Discipline(name); | |
create index on :Athlete(name); | |
create index on :Event(name); | |
create index on :Year(name); | |
create index on :Gender(name); | |
create constraint on (c:Country) assert c.noc is unique; |
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
generatePagesArray: function(currentPage, collectionLength, rowsPerPage, paginationRange) | |
{ | |
var pages = []; | |
var totalPages = Math.ceil(collectionLength / rowsPerPage); | |
var halfWay = Math.ceil(paginationRange / 2); | |
var position; | |
if (currentPage <= halfWay) { | |
position = 'start'; | |
} else if (totalPages - halfWay < currentPage) { |
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
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
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/bash | |
# Adicione um novo remote; pode chamá-lo de "upstream": | |
git remote add upstream https://github.com/usuario/projeto.git | |
# Obtenha todos os branches deste novo remote, | |
# como o upstream/master por exemplo: | |
git fetch upstream |
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
// http://locutus.io/php/misc/uniqid/ | |
function uniqid (prefix, moreEntropy) => { | |
if (typeof prefix === 'undefined') { | |
prefix = ''; | |
} | |
let retId; | |
const _formatSeed = function (seed, reqWidth) { | |
seed = parseInt(seed, 10).toString(16); // to hex str | |
if (reqWidth < seed.length) { |
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
import { deburr, sortBy } from 'lodash' | |
const sanitizeAndLower = value => deburr(value).toLowerCase() | |
// | |
const sortByString = (list, key) => sortBy(list, x => sanitizeAndLower(x[key])) | |
const sortByName = list => sortByString(list, 'name') |