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
rsync -av --exclude='folder1' --exclude='folder2' origin/ dest/ |
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 a mapped object by any identifier | |
example: | |
var a = [{id:1, name:'a'},{id:2, name:'b'},{id:3, name:'c'}]; | |
a.mapBy('id') | |
output: [ | |
{1:{id:1,name:'a'}}, | |
{2:{id:2,name:'b'}}, | |
{3:{id:3,name:'c'}} | |
] |
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 obj = {}; | |
var strUTM = "https://myapp.com/?utm_source=Facebook&utm_medium=Social&utm_term=pinned-post&utm_content=First-Post-Philly&utm_campaign=Philly-Launch"; | |
strUTM.replace(/^.+\?/, '').split('&').forEach(function (i) { obj[i.split('=')[0]] = i.split('=')[1] }) | |
/* | |
Object { | |
utm_source: "Facebook", | |
utm_medium: "Social", | |
utm_term: "pinned-post", |
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
@mixin before-after-background($height, $side-width, $before, $after) { | |
height: $height; | |
position: relative; | |
z-index: 1; | |
&:before, &:after { | |
content: ''; | |
display: block; | |
height: $height; | |
position: absolute; |
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
let format = 'BLACK: 5:00 MIN/KM'; | |
format.replace(/MIN|KM|MI/gi, $1 => $1.toLowerCase()); |
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
/** | |
Challenge | |
Have the function LongestWord(sen) take the sen parameter being passed and return the largest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. | |
Sample Test Cases | |
Input:"fun&!! time" | |
Output:"time" | |
Input:"I love dogs" |
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
/** | |
Challenge | |
Factorial | |
Sample Test Cases | |
Input: 1 | |
Output: 1 | |
Input: 4 |
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
/** | |
Challenge | |
Using the JavaScript language, have the function FirstReverse(str) take the str parameter being passed and return the string in reversed order. For example: if the input string is "Hello World and Coders" then your program should return the string sredoC dna dlroW olleH. | |
Sample Test Cases | |
Input:"coderbyte" | |
Output:"etybredoc" | |
Input:"I Love Code" |
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 { | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLSchema, | |
graphql | |
} = require('graphql'); | |
const schema = new GraphQLSchema({ | |
query = new GraphQLObjectType({ | |
name: 'Query', |
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
// https://stackoverflow.com/questions/4959975/generate-random-number-between-two-numbers-in-javascript | |
getRandomNumber = function(min, max) { | |
min = typeof(min) === 'number' && min % 1 === 0 ? min : 0; | |
max = typeof(max) === 'number' && max % 1 === 0 ? max : 0; | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} |
OlderNewer