find . -mindepth 2 -type f -print -exec mv {} . ;
find . -name "node_modules" -type d -print -exec rm -rf '{}' +
find . -name "imagewithcta" -type d -print
| class Prom { | |
| constructor(promiseCallback) { | |
| this.state = "pending"; | |
| this.value = undefined; | |
| this.calledResolve = false; | |
| this.calledReject = false; | |
| this.innerResolve = () => {}; | |
| this.innerReject = () => {}; | |
| promiseCallback(this.resolved.bind(this), this.rejected.bind(this)); | |
| } |
| /usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' |
| var a = `<!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <a href="1.html">Hello World</a> |
| concatenatedArray=($(ls $Dir) $(ls $AnotherDir)) | |
| Array=() | |
| Array+=("value") | |
| Array+=("AnotherValue") | |
| echo ${Array[@]} | |
| echo ${#Array[@]} | |
| # Performing Bubble sort | |
| for ((i = 0; i<${#array[@]}-1; i++)) | |
| do | |
| # echo $i | |
| for((j = 0; j<${#array[@]}-1; j++)) | |
| do | |
| if ((${#array[j]} < ${#array[$((j+1))]})) | |
| then | |
| temp=${array[$j]} | |
| array[$j]=${array[$((j+1))]} |
| var f = ['women','men']; | |
| var context = require.context('./', true, /.scss$/); | |
| var module = context.keys(); | |
| module.sort(function(a,b){ | |
| return (f.indexOf(a.split('/')[1])>f.indexOf(b.split('/')[1])) | |
| }); | |
| console.log(module); | |
| //module.forEach(context) | |
| //// execute them | |
| module.forEach(function(key) { |
| (function () { | |
| function log(x) { | |
| console.log('My value: ' + x); | |
| } | |
| var funcs = []; | |
| for (var i = 0; i < 3; i++) { | |
| funcs[i] = log.bind(null, i); | |
| } |
| var BrowserDetectMixin = { | |
| // Lifted from: | |
| // http://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie/21712356#21712356 | |
| detectIE: function() { | |
| var ua = window.navigator.userAgent; | |
| var msie = ua.indexOf('MSIE '); | |
| if (msie > 0) { | |
| // IE 10 or older => return version number | |
| return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); |
| $.event.special.abetap = { | |
| delegateType: "tap", | |
| bindType: "tap", | |
| handle: function (event) { | |
| var handleObj = event.handleObj; | |
| var targetData = jQuery.data(event.target); | |
| var ret = null; | |
| event.preventDefault(); |