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 glob = require('glob'); | |
const jsFiles = glob.sync('src/**/*.js'); | |
const tsFiles = glob.sync('src/**/*.ts'); | |
const tsxFiles = glob.sync('src/**/*.tsx'); | |
const allTsFiles = tsFiles.concat(tsxFiles); | |
console.log(`There are ${jsFiles.length} .js files in the 'src' directory.`); | |
console.log(`There are ${allTsFiles.length} .ts/x files in the 'src' directory.`); | |
console.log(`${Math.round((allTsFiles.length / jsFiles.length) * 100)}% of the files are TypeScript files.`); |
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
/** | |
* Opens a new browser window | |
* @param {String} url The url of the window to open | |
* @param {String} name The name of this window | |
* @param {Number} width Window width | |
* @param {Number} height Window height */ | |
const PopUpWindow = (url, name, width, height)=> { | |
// Center the window | |
let _width = width || 450, | |
_height = height || 300, |
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 genPrimes(min, max){ | |
var isPrime, primes = []; | |
for (var i = min; i <= max; i++) { | |
isPrime = true; | |
for (var j = min; j * j <= i; j++) { | |
if (i % j === 0) { | |
isPrime = false; | |
break; | |
} | |
} |
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
/* source: all over the interwebz */ | |
/*------------------------ Smartphones ------------------------ */ | |
/* Portrait & Landscape */ | |
@media only screen | |
and (min-width : 320px) | |
and (max-width : 480px) { | |
/* styles */ | |
} | |
/* Landscape */ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://static.jquery.com/ui/css/base2.css" type="text/css" media="all" /> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/blitzer/jquery-ui.css" type="text/css" media="all" /> | |
<!--http://ajax.googleapis.com/ajax/libs/jqueryui/[UI.VERSION]/themes/[THEME-NAME]/jquery-ui.css--> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script> |
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 ellipsis(numOfWords, text, wordCount ) { | |
wordCount = text.trim().replace(/\s+/g, ' ').split(' ').length; | |
if(numOfWords <= 0 || numOfWords === wordCount){ | |
return text; | |
} else { | |
text = text.trim().split(' '); | |
text.splice(numOfWords, wordCount, '...'); | |
return text.join(' '); | |
} | |
} |
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
// {Boolean} c Condition | |
// {String} f File name | |
var loadjs = function(c,f) { | |
var l = f.length; | |
if ( c && f.substring(l - 3, l) === ".js") { | |
var j = document.createElement('script'); | |
j.type = 'text/javascript'; | |
j.src = f; | |
j.async = false; | |
if (typeof j != "undefined") { |
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
<link rel="apple-touch-icon" href="touch-icon-iphone.png" /> | |
<link rel="apple-touch-icon" sizes="72x72" href="touch-icon-ipad.png" /> | |
<link rel="apple-touch-icon" sizes="114x114" href="touch-icon-iphone4.png" /> | |
<!--src:http://bit.ly/gWFA6M--> |
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
javascript:(function(){(function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0];otherlib=false,msg='';el.style.position='fixed';el.style.height='32px';el.style.width='220px';el.style.marginLeft='-110px';el.style.top='0';el.style.left='50%';el.style.padding='5px 10px 5px 10px';el.style.zIndex=1001;el.style.fontSize='12px';el.style.color='#222';el.style.backgroundColor='#f99';function getLint(url){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;}};head.appendChild(script);}function getScript(url,success){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done= |
NewerOlder