Skip to content

Instantly share code, notes, and snippets.

View bhanu951's full-sized avatar

Bhanu bhanu951

  • India
View GitHub Profile
http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect
https://www.drupal.org/node/116539
http://makitweb.com/category/jquery/
geeksforgeeks.org
http://www.ryanwright.me/cookbook/drupal7/table/table-drag/simple
const styles = ".node-project-release .field-name-body li { margin: 0.5rem 0; } .node-project-release .issue-meta { font-size: 85%; color: #666; }"
const css = document.createElement('style');
css.type = 'text/css';
css.appendChild(document.createTextNode(styles));
document.querySelector('head').appendChild(css);
const issueLinks = document.querySelectorAll('.node-project-release .field-name-body li a');
issueLinks.forEach(function(link) {
const text = link.innerHTML;
link.innerHTML = text.replace(/Issue #\d+[^:]*:/, function (match) {
@bhanu951
bhanu951 / NestedEntityReference.php
Created August 11, 2023 17:05 — forked from GuyPaddock/NestedEntityReference.php
NestedEntityReference utility class for safely getting access to ER fields
<?php
namespace Drupal\my_utiilities\Utility;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\TypedData\DataReferenceInterface;
@bhanu951
bhanu951 / load_dotenv.sh
Created July 25, 2023 09:27 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.