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() { | |
'use strict'; | |
angular | |
.module('app') | |
.config(config); | |
config.$inject = ['$httpProvider']; | |
/** @ngInject */ |
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
$timestamp = 1458356400; | |
$startOfDay = strtotime('midnight', $timestamp); | |
$endOfDay = strtotime('tomorrow', strtotime('midnight', $timestamp)) - 1; |
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
# Reset to a previous commit ignoring any work done | |
git reset --hard COMMIT_HASH | |
# Reset to a previous commit keeping work | |
git stash | |
git reset --hard COMMIT_HASH | |
git stash pop |
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
class SomeInfinityLoadingSearch extends Component { | |
state = { | |
isLoading: false, | |
} | |
handleScroll = () => { | |
if (((window.innerHeight + window.scrollY) >= document.body.offsetHeight) && !this.state.isLoading) { | |
this.setState({ | |
isLoading: true, | |
}); |
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
import fs from 'fs'; | |
import path from 'path'; | |
const readDir = path => fs.readdirSync(path); | |
const outputDir = '/Users/Lucas/Downloads/Font'; | |
const rootPath = '/Users/Lucas/Downloads/Icons'; | |
const files = readDir(rootPath); | |
const getDirectories = (dirFiles, srcPath) => dirFiles.filter(file => fs.statSync(path.join(srcPath, file)).isDirectory()); |
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
Show hidden characters
{ | |
"presets": [ | |
["es2015", { | |
"modules": false | |
}], | |
"react", | |
"stage-0" | |
], | |
"compact": "true", | |
"plugins": [ |
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
find . -name "node_modules" -exec rm -rf '{}' + |
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
machine: | |
node: | |
version: 6.10.1 | |
services: | |
- redis | |
dependencies: | |
pre: | |
# Install Yarn | |
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg | |
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list |
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
/** | |
* Sanitize a test text removing the mentions of a `ObjectId` | |
* @param text {string} The text to be sanitized | |
* @returns {string} The sanitized text | |
*/ | |
export const sanitizeTestText = (text) => { | |
const values = text.split(' '); | |
return values.map((value) => { | |
// Remove any non-alphanumeric character from value | |
const cleanValue = value.replace(/[^a-z0-9]/gi, ''); |
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
/** | |
* Copyright (c) 2017-present, Wonday (@wonday.org) | |
* All rights reserved. | |
* | |
* This source code is licensed under the MIT-style license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/ | |
'use strict'; | |
import React, {Component} from 'react'; |
OlderNewer