Skip to content

Instantly share code, notes, and snippets.

View ArjunKishore's full-sized avatar

Arjun Kishore ArjunKishore

  • Australia
View GitHub Profile
@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 / 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 / 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(','));
}
@ArjunKishore
ArjunKishore / SimpleXMLElement-node-existence.php
Created May 7, 2018 07:45 — forked from Thinkscape/SimpleXMLElement-node-existence.php
How to check if a <child> node exists in SimpleXMLElement document ? Comparison of different approaches.
<?php
/**
* The only reliable way of determining if a child exists
* in SimpleXMLElement is to use count(). All other methods
* do not work reliably in global or local NS.
*
* NOTE: Error suppresion on @count() is used to suppress
* "PHP Warning: count(): Node no longer exists"
*/
if(!class_exists('SimpleXMLElement')) die("Bonkers");