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 CustomNumberSelect from './customNumberSelect' | |
export default { | |
name: 'sizes', | |
type: 'number', | |
inputComponent: CustomNumber, | |
options: { | |
list: [ | |
{title: 'xsmall', value: 1}, | |
{title: 'small', value: 2}, |
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
for file in *.png; do mv "$file" "prefix-we-want-$file"; done; |
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
grep -rl "string" "/path/to/files" | xargs basename > list-of-files.txt |
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 pathPrefixes = { | |
blog: 'blog', | |
features: 'features', | |
authors: 'blog/authors', | |
'blog-categories': 'blog/category' | |
} | |
exports.onCreateNode = ({ node, getNode, actions }) => { | |
const { createNodeField } = actions |
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 newArray = myArray.map(a => Object.assign({}, a)); |
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
var p1 = objectOne.position; | |
var p2 = objectTwo.position; | |
var distance = Math.sqrt( | |
(p1.x - p2.x) * (p1.x - p2.x) + (p1.z - p2.z) * (p1.z - p2.z) | |
); |
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
nameArray = ['Mike', 'Tom', 'Jose']; | |
randomArrayItem = Math.floor(Math.random() * nameArray.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 React, { Component } from 'react'; | |
import { gql, graphql, compose } from 'react-apollo'; | |
import request from 'superagent'; | |
import LoadingFetch from '../helpers/LoadingFetch'; | |
import SingleInput from '../forms/SingleInput'; | |
class AddEditTalent extends Component { | |
constructor() { | |
super(); |
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 limit_text($text, $limit) { | |
if (str_word_count($text, 0) > $limit) { | |
$words = str_word_count($text, 2); | |
$pos = array_keys($words); | |
$text = substr($text, 0, $pos[$limit]) . '...'; | |
} | |
return $text; | |
} |
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
//We need the window to load completely before using this function | |
jQuery(window).load(function() { | |
jQuery('.some-form').submit(function (e) { | |
e.preventDefault(); | |
var checkedProfessions = jQuery('.checkbox-container input:checkbox:checked').map(function() { | |
return jQuery(this).val(); | |
}).get(); //Converts to array | |
console.log(checkedProfessions); | |
}); | |
}); |
NewerOlder