Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
});
@xkxd
xkxd / linesOfCode.js
Created January 26, 2017 00:23
get total number of lines of code in github repository
// go to `Contributors` and paste this in console
function linesOfCode(addedCssSelector = '.a', removedCssSelector = '.d') {
const repoName = document.querySelector('[itemprop=name] a').innerText;
const getLOC = (selector) =>
Array.from(document.querySelectorAll(`.cmeta ${selector}`))
.reduce(((sum, element) =>
sum += +element.innerText.replace(',','').slice(0, -2)), 0)
return `Total number of LOC in >>${repoName}<< repository is ${getLOC(addedCssSelector) - getLOC(removedCssSelector)}`;
@xkxd
xkxd / removePolishChars
Created March 29, 2015 14:37
removing polish characters form a string
function removePolishChars(elem) {
var regExp = /ą|ć|ę|ł|ń|ó|ś|ź|ż/gi;
return elem.replace(regExp, _replace);
function _replace(match, offset, string) {
switch (match.toLowerCase()) {
case "ą":
return "a";