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
// Bonfire: Seek and Destroy | |
// Author: @hallaathrad | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy?solution=function%20destroyer(arr)%20%7B%0A%20%20var%20taBort%20%3D%20Array.prototype.slice.call(arguments%2C1)%3B%0A%20%20return%20arr.filter(function(obj)%7Breturn%20(taBort.indexOf(obj)%3C0)%3B%7D)%3B%0A%7D%0A%0Adestroyer(%5B1%2C%202%2C%203%2C%201%2C%202%2C%203%5D%2C%202%2C%203)%3B%0A | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function destroyer(arr) { | |
var taBort = Array.prototype.slice.call(arguments,1); | |
return arr.filter(obj => taBort.indexOf(obj)<0); | |
} |
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
fire-where-do-i-belong.js | |
// Bonfire: Where do I belong | |
// Author: @hallaathrad | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function where(arr, num) { | |
// Find my place in this sorted array. | |
arr.push(num); | |
return arr.sort(function(x,y){return x<y?-1:x>y?1:0;}).indexOf(num); |
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 fzbz = Array .apply(null, { length: 101 }) | |
.map(Number.call, Number) | |
.map(obj => obj % 3 === 0 && obj % 5 === 0 ? | |
'fizzbuzz' : obj % 3 === 0 ? | |
'fizz' : obj % 5 === 0 ? | |
'buzz' : obj); | |
fzbz.shift(); |
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 convert(num) { | |
var x = ''; | |
[1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1].map( | |
function(obj,i){ | |
while (num>=obj){ | |
x+=['M','CM','D','CD','C','XC','L','XL','X','IX','V','IV','I'][i]; | |
num-=obj;}}); | |
return x; | |
} | |
convert(36); |
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
/** | |
* @param {Function} fn Function to curry. | |
* @param {Number} lenght The arguments required to invoke the function. Optional. By default is fn.length | |
* @returns {Function} The currified function. | |
*/ | |
function curry(fn, length) { | |
length = length || fn.length; | |
return function currified() { | |
var args = [].slice.call(arguments); |
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
module.exports = { | |
env: { | |
'browser': true, | |
'commonjs': true, | |
'es6': true, | |
'jest/globals': true, | |
'jquery': true, | |
}, | |
extends: [ | |
'airbnb', |
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
module.exports = { | |
extends: 'stylelint-config-standard', | |
ignoreAtRules: ['element', '/^define/'], | |
ignoreFiles: './dist/*' | |
}; |
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 webpack = require('webpack'); | |
const path = require('path'); | |
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); | |
const HtmlWebpack = require('html-webpack-plugin'); | |
const HtmlWebpackAssetsPlugin = require('html-webpack-include-assets-plugin'); | |
const WebpackNotifierPlugin = require('webpack-notifier'); | |
const AssetsPlugin = require('assets-webpack-plugin'); | |
const Visualizer = require('webpack-visualizer-plugin') | |
const BUILD_DIRECTORY = 'src'; |
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
public static JObject GetWebpackAssetsJson(string applicationBasePath) | |
{ | |
JObject webpackAssetsJson = null; | |
string packageJsonFilePath = $"{applicationBasePath}\\{"package.json"}"; | |
using (StreamReader packageJsonFile = File.OpenText(packageJsonFilePath)) | |
{ | |
using (JsonTextReader packageJsonReader = new JsonTextReader(packageJsonFile)) | |
{ | |
JObject packageJson = (JObject)JToken.ReadFrom(packageJsonReader); |
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
{ | |
"name": "template", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "SET NODE_ENV=development && webpack-dev-server --progress --color --env=development", | |
"iis": "SET NODE_ENV=development && rimraf ./dist/* && webpack --progress --watch --color --env=production", | |
"build": "SET NODE_ENV=production && SET BABEL_ENV=production && rimraf ./dist/* && webpack -p --progress --color --env=production", | |
"buildDev": "SET NODE_ENV=development && SET BABEL_ENV=development && rimraf ./dist/* && webpack --progress --color --env=development", |
OlderNewer