Skip to content

Instantly share code, notes, and snippets.

@dinusuresh
dinusuresh / install-docker-elementary-loki.sh
Created August 6, 2018 07:36 — forked from ChrisTimperley/install-docker-elementary-loki.sh
Installs Docker on Elementary OS 0.4 (Loki)
#!/bin/bash
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo rm -f /etc/apt/sources.list.d/docker.list
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -u -cs) \
stable"
sudo apt-get update
sudo apt-get purge lxc-docker
@dinusuresh
dinusuresh / manifest.json
Last active September 27, 2017 11:53
PWA Web Manifest
{
"name": "PWA Demo Application",
"short_name": "PWA Demo",
"icons": [
{"src": "/assets/icon.png", "sizes": "152x152"},
{"src": "/assets/icon.png", "sizes": "144x144"},
{"src": "/assets/icon.png", "sizes": "192x192"},
{"src": "/assets/icon.png", "sizes": "256x256"},
{"src": "/assets/icon.png", "sizes": "512x512"}
],
import {AfterViewInit, Directive, ElementRef, OnInit, Optional, Renderer} from '@angular/core';
import {ModalDirective} from 'ng2-bootstrap';
@Directive({
selector: '[appAutoFocus]'
})
export class AutoFocusDirective implements OnInit, AfterViewInit {
constructor(private el: ElementRef, private renderer: Renderer, @Optional() private modal: ModalDirective) {
}
@dinusuresh
dinusuresh / .bashrc
Last active March 16, 2017 09:06
View git branch name and user email on terminal
# BEGIN -- git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ >> \1 <</'
}
parse_git_email() {
BRANCH="$(parse_git_branch)"
#echo -ne "$BRANCH"
if [ -n "$BRANCH" ]; then
git config user.email
fi
@dinusuresh
dinusuresh / gist:6a7139d8508bc7d59db7a9adac6b6b58
Created May 21, 2016 06:24
Apache Angular Pretty URL config
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html