Skip to content

Instantly share code, notes, and snippets.

View niqdev's full-sized avatar

niqdev

  • Dublin
View GitHub Profile
#!/bin/env python
"""
sudo easy_install pip
pip search pypdf
sudo pip install PyPDF2
chmod u+x pdf_meta.py
python pdf_meta.py
"""
@niqdev
niqdev / rename-branch-github.txt
Last active January 15, 2020 18:17
Rename local and remote branch on GitHub
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@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

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 / 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
@niqdev
niqdev / setup-gradle.md
Last active March 5, 2024 13:53
Setup Gradle on Linux

Setup Gradle

Download

mkdir -p ~/opt/packages/gradle && cd $_
wget https://services.gradle.org/distributions/gradle-3.1-all.zip
unzip gradle-3.1-all.zip

Install and setup