Skip to content

Instantly share code, notes, and snippets.

View niqdev's full-sized avatar

niqdev

  • Dublin
View GitHub Profile
@niqdev
niqdev / mac-port.txt
Last active September 16, 2015 08:12
Who is listening on a given TCP port on Mac OS X
lsof -i -n -P | grep TCP
@niqdev
niqdev / angular-module-info
Created January 12, 2016 15:42
lists/enumarates all angular application module
# lists/enumarates all angular application module
var allModules = angular.module('myApplication').requires;
# lists/enumarates all angular module service/controller/directive ...
angular.module('myApplication')['_invokeQueue'].forEach(function(value) {
console.log(value[1] + ": " + value[2][0]);
});
@niqdev
niqdev / redux-timeout
Created March 4, 2016 16:52
apply changes to my forked repo after pull request
cd redux-timeout/
# lists all remotes
git remote -v
# add another remote (SSH)
git remote add gpfunk git@github.com:gpfunk/redux-timeout.git
git remote -v
git fetch -p
@niqdev
niqdev / openwebnet.xyz
Created March 24, 2016 17:47
setup github.io
git clone https://github.com/openwebnet/openwebnet-site.git
cd openwebnet-site/
mkdir dist
cd dist
echo "Hello World" > index.html
echo "openwebnet.xyz" > CNAME
cat index.html
cat CNAME
cd ..
git add .
@niqdev
niqdev / update-package
Created March 24, 2016 18:11
Update each dependency in package.json to the latest version
npm install -g npm-check-updates
npm-check-updates -u
npm install
@niqdev
niqdev / openwebnet-android-rebase
Last active April 21, 2016 12:18
apply changes to a forked repo after the pull request
cd openwebnet-android
# lists all remotes
git remote -v
# add my remote to your repo (SSH)
git remote add niqdev git@github.com:openwebnet/openwebnet-android.git
# verify
git remote -v

Create library

Interactively create a package.json file and create Gruntfile.js file

npm init
npm install grunt --save-dev
npm install <LIBRARY> --save-dev

Setup package manager

@niqdev
niqdev / cloneAll.sh
Created November 18, 2016 09:56
Clone all remote branches at once
#!/bin/bash
for i in $(git branch -r | grep -vE "HEAD|master"); do
git branch --track ${i#*/} $i; done
@niqdev
niqdev / kats2.scala
Last active January 21, 2017 10:40
meetup-20170118
// https://projecteuler.net/problem=8
// ---------- LargestProduct.scala ----------
import scala.annotation.tailrec
object LargestProduct {
def solution(s: String, magnitude: Int): Long = {
def charToLong(c: Char): Long = c.toLong - 48L

Install Play

wget https://downloads.typesafe.com/typesafe-activator/1.3.12/typesafe-activator-1.3.12-minimal.zip -P Downloads/
unzip Downloads/typesafe-activator-1.3.12-minimal.zip -d ~/opt/typesafe

# add to PATH
vim .bashrc
export ACTIVATOR='~/opt/typesafe/activator-1.3.12-minimal/'
export PATH=$PATH:$ACTIVATOR/bin
source .bashrc