Skip to content

Instantly share code, notes, and snippets.

View ArjunKishore's full-sized avatar

Arjun Kishore ArjunKishore

  • Australia
View GitHub Profile
@ArjunKishore
ArjunKishore / deleteLocalBranches.txt
Created September 9, 2021 02:45
Delete local git branches which are not in remote
git branch --merged origin/develop | xargs git branch -d
@ArjunKishore
ArjunKishore / gist:cc6ff150a6e4a532e72c0b3a583487bd
Created July 24, 2020 03:47 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@ArjunKishore
ArjunKishore / docker-php-ext-install.md
Created June 11, 2020 12:30 — forked from giansalex/docker-php-ext-install.md
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@ArjunKishore
ArjunKishore / gist:83dab67cbef41088a4fda3bad2cfbffe
Created August 8, 2019 08:21
Create release notes in Git
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt
@ArjunKishore
ArjunKishore / gist:24eaab73cd0229a0b062270491c94770
Created August 8, 2019 08:21
Create release notes in Git
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt
@ArjunKishore
ArjunKishore / gist:0334d37001b9e1a247a4c96d02c9c9ca
Created August 8, 2019 08:21
Create release notes in Git
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt
@ArjunKishore
ArjunKishore / inject-service-drupal-8.md
Created November 19, 2018 06:06 — forked from jmolivas/inject-service-drupal-8.md
Inject a service from the service container

Inject a Service in Drupal 8

Is a good practice to inject a service whenever is possible.

You can verify the service name by:

Looking at the Drupal Static Service Container wrapper class.

Reading the code on the Drupal Class you can find the httpClient method:

 /**
@ArjunKishore
ArjunKishore / install-docker.sh
Created November 8, 2018 01:49 — forked from dweldon/install-docker.sh
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@ArjunKishore
ArjunKishore / redirect.js
Last active May 17, 2018 00:56
Redirect and Post data using Javascript
var redirectToUrl = function (url,data) {
// optional parameter
data = data ||0;
var form = document.createElement('form');
form.method = 'post';
form.action = url;
for (var name in data) {
var input = document.createElement('input');
input.type = 'hidden';
input.name = name;
@ArjunKishore
ArjunKishore / arrayToCSV.js
Created May 10, 2018 04:10 — forked from yangshun/arrayToCSV.js
Converts a 2D array into a CSV file
function arrayToCSV (twoDiArray) {
// Modified from: http://stackoverflow.com/questions/17836273/
// export-javascript-data-to-csv-file-without-server-interaction
var csvRows = [];
for (var i = 0; i < twoDiArray.length; ++i) {
for (var j = 0; j < twoDiArray[i].length; ++j) {
twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas
}
csvRows.push(twoDiArray[i].join(','));
}