Skip to content

Instantly share code, notes, and snippets.

View aravinthanpnk's full-sized avatar
🎯
Focusing

Aravinthan.K aravinthanpnk

🎯
Focusing
View GitHub Profile
@aravinthanpnk
aravinthanpnk / perfectelementary.bash
Created June 6, 2016 12:30
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@aravinthanpnk
aravinthanpnk / gist:c181418f0373aa96be2691ca5ca31203
Created March 26, 2017 10:58 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@aravinthanpnk
aravinthanpnk / README-Template.md
Created January 20, 2018 04:59 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@aravinthanpnk
aravinthanpnk / angularjs-$compile.js
Created July 18, 2018 09:30 — forked from carmichaelize/angularjs-$compile.js
AngularJS $compile example
function MyDirective ($templateRequest, $compile) {
var templateBase = '/directives/my_directive/views/';
var childTemplates = {
child1: 'child1.html',
child2: 'child2.html'
};
return {
@aravinthanpnk
aravinthanpnk / build.gradle
Created August 2, 2018 14:44 — forked from mizanRahman/build.gradle
ssh remote deploy with gradle
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.hidetake:gradle-ssh-plugin:1.1.4"
}
@aravinthanpnk
aravinthanpnk / gist:d726724035bab69f10a769e8eedb70d6
Created October 15, 2019 08:22
To find Swap Memory Usage in Linux
for file in /proc/*/status ; do awk '/Tgid|VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | grep kB | sort -k 3 -n
@aravinthanpnk
aravinthanpnk / gist:aa4a99b24f1852651f75ed797aa1106b
Created February 12, 2020 05:51
Git remove Local Branches which not available in remote
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done