Skip to content

Instantly share code, notes, and snippets.

View sava-vidakovic's full-sized avatar

Sava Vidakovic sava-vidakovic

  • Belgrade
View GitHub Profile
#!/usr/bin/env bash
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print €1.73 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
git commit -a -m "v$PACKAGE_VERSION"
git tag -a "v$PACKAGE_VERSION" -m "v$PACKAGE_VERSION"
git push && git push --tags
@sava-vidakovic
sava-vidakovic / bling.js
Created May 31, 2017 15:52 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
/** A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If that value has two digits, continue reducing in this way until a single-digit number is produced. This is only applicable to the natural numbers.
*
* Here's how it works (Ruby example given):
*
* digital_root(16)
* => 1 + 6
* => 7
*
* digital_root(942)
* => 9 + 4 + 2
FROM node:6.4
ENV NPM_CONFIG_LOG_LEVEL warn
WORKDIR /code/
COPY npm-shrinkwrap.json .
RUN npm install
// Equal Sides Of An Array
function findEvenIndex(arr) {
var sum = 0,
leftSum = 0;
for (var i = 0; i < arr.length; i++) {
sum += arr[i];
}
function likes (names) {
var templates = [
'no one likes this',
'{name} likes this',
'{name} and {name} like this',
'{name}, {name} and {name} like this',
'{name}, {name} and {n} others like this'
];
var idx = Math.min(names.length, 4);

To delete all branches that are already merged into the currently checked out branch:

$ git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3

#How to install Oracle Java on Manjaro

Download Oracle Java:

$ wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=109700 -O Java-latest

Extract the downloaded file:

$ tar zxvf jre-7u7-linux-i586.tar.gz 
A shell script which will fix the problem where you want to stop using sudo for npm -g on Ubuntu.
https://github.com/glenpike/npm-g_nosudo
# Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
# Then install with:
sudo apt-get install -y nodejs