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
$a = Get-ChildItem C:\Scripts -recurse | Where-Object {$_.PSIsContainer -eq $True} | |
$a | Where-Object {$_.GetFiles().Count -eq 0} | Select-Object FullName |
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
// Shortcut to get elements | |
var el = function(element) { | |
//deicide one or array? | |
//or element.charAt(0) === "#" | |
if (element[0] === "#") { // If passed an ID... | |
// The querySelector() method returns the first element that matches a specified CSS selector(s) in the document. | |
return document.querySelector(element); // ... returns single element | |
} | |
// e querySelectorAll() method returns all elements in the document that matches a specified CSS selector(s), | |
// as a static NodeList object. |
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
var buttonNumbers = document.getElementsByClassName("numbers"); | |
// example assigment for calculator number buttons | |
//copy this in order to work for ( of ) | |
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; | |
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; | |
for (var button of buttonNumbers) { | |
button.addEventListener("click", numberEventHandler); | |
} | |
function numberEventHandler(e) { |
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
dir | Where-Object {$_.Name -cmatch "^[A-Z][a-z]+[A-Z][a-z]*"} //DarkSoulsIII.lnk |
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
Get-ChildItem C:\Scripts | Where-Object {$_.Name -match "\d"} |
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
Get-ChildItem -Filter “*shortcut*” |Rename-Item -NewName {$_.name -replace ‘shortcut’,’’} | |
//or for subfolders | |
//Get-ChildItem -Filter “*current*” -Recurse | Rename-Item -NewName {$_.name -replace ‘current’,’old’ } |
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
Object.keys(window).length //186 |
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
//second year mode (I don't want use function isInsertYear2 and isInsertYear1) | |
var second = false; | |
//insert year or not? | |
function isInsertYear (year1,year2,month1,month2,days1,days2) { | |
//second date or first date? | |
if(second) { | |
if(year1==year2) return false; | |
if(year1!=year2) { | |
if(year2>year1&&year2-year1==1) { | |
if(days1==days2) return 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
var assert = chai.assert; | |
// var b = c.d.e.f.g.h.j.k.l.m.n.o.p.q.r.t.u.v; | |
// b === c.d.e.f.g.h.j.k.l.m.n.o.p.q.r.t.u.v = 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
/**/*.min.{js,css} | |
// Example of using | |
// gulp.task('watch', ['browser-sync' /*,'sass'*/ ], function() { | |
//gulp.watch('app/**/*.html',['sass']); | |
// gulp.watch('app/sass/**/*.sass', ['sass']); | |
// gulp.watch('*.html').on('change', browserSync.reload); | |
// gulp.watch('*.css').on('change', browserSync.reload); | |
// gulp.watch('js/**/*.js').on('change', browserSync.reload); | |
// }); |