Skip to content

Instantly share code, notes, and snippets.

View RishiKulshreshtha's full-sized avatar
🏠
Working from home

Rishi Kulshreshtha RishiKulshreshtha

🏠
Working from home
View GitHub Profile
@RishiKulshreshtha
RishiKulshreshtha / .lando.yml
Last active June 27, 2020 04:58
A packed lando configuration containing essentials
name: drupal
recipe: drupal9
config:
php: '7.3'
via: nginx
webroot: .
xdebug: true
drush: ^10
database: mysql:5.7
services:
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@RishiKulshreshtha
RishiKulshreshtha / docker-cleanup-resources.md
Created November 21, 2018 07:46 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@RishiKulshreshtha
RishiKulshreshtha / php.ini
Created July 24, 2018 12:00
Update php.ini in MAMP
sudo code /Applications/MAMP/bin/php/php5.6.32/conf/php.ini
sudo code /Applications/MAMP/conf/php5.6.32/php.ini

MAMP PRO 4 Trial Reset

A simple script that resets latest MAMP PRO 4 trial validity, and keeps your data safe.

How to use

  • Copy the code into a file OR download the script and save it as reset_mamp4.sh
  • Open the Terminal app and write chmod +x then drag and drop the file on the Terminal. You should have something like chmod +x reset_mamp4.sh. Press Enter to run it.
  • Now, run the file itself by dragging and dropping it on the Terminal (something like reset_mamp4.sh) then pressing Enter.
  • Open MAMP PRO and check if you have 14 days left now.

Didn't work?

@RishiKulshreshtha
RishiKulshreshtha / openssl.yml
Created August 16, 2017 18:00
HTTPS on MAMP
openssl req -new -nodes -newkey rsa:2048 -subj '/C=IN/ST=MH/L=Pune/O=Organisation/OU=Development/emailAddress=address@example.com/CN=localhost/subjectAltName=DNS.1=192.168.0.1/' -keyout server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
cp server.key server.tmp
openssl rsa -in server.tmp -out server.key
cp server.crt /Applications/MAMP/conf/apache
cp server.key /Applications/MAMP/conf/apache
//
openssl req -new -sha256 \
-key server.key \
@RishiKulshreshtha
RishiKulshreshtha / YOURTHEME.theme
Created June 22, 2017 13:07
Adding Taxonomy Term to the Node's Breadcrumb
<?php
/**
* @file
* Place your custom PHP code in this file.
*/
/**
* Implements HOOK_preprocess_breadcrumb().
*/
@RishiKulshreshtha
RishiKulshreshtha / drupal-vm
Last active June 5, 2017 08:16
drupal-vm - Issue (Add repository for PHP versions (Ubuntu))
Last login: Mon Jun 5 12:27:48 on ttys000
in-it0483:drupal-vm rishi.kulshreshtha$ vagrant up
Bringing machine 'drupalvm' up with 'virtualbox' provider...
==> drupalvm: Importing base box 'geerlingguy/ubuntu1604'...
==> drupalvm: Matching MAC address for NAT networking...
==> drupalvm: Checking if box 'geerlingguy/ubuntu1604' is up to date...
==> drupalvm: Setting the name of the VM: drupalvm.dev
==> drupalvm: Clearing any previously set network interfaces...
==> drupalvm: Preparing network interfaces based on configuration...
drupalvm: Adapter 1: nat
@RishiKulshreshtha
RishiKulshreshtha / image_style_generate.module
Last active October 21, 2016 09:50
image_style_generate.module
<?php
/**
* Implements hook_node_insert to generate derivative images for the new inserted node in
* case they are not generated
* @param object $node
*/
function image_style_generate_node_insert($node) {
// REPLACE field_YOUR_IMAGE_FIELD WITH YOUR FIELD IMAGE NAME
if (isset($node->field_image['und'][0]['uri'])) {