Skip to content

Instantly share code, notes, and snippets.

View deltorosalazar's full-sized avatar

Manuel F. Del Toro deltorosalazar

View GitHub Profile
@deltorosalazar
deltorosalazar / settings.php
Last active January 25, 2019 02:55
Drupal 8 DB Configuration
$dbopts['scheme'] = 'postgres';
$databases['default']['default'] = array(
'database' => 'my_database_name',
'username' => 'deltorosalazar',
'password' => '',
'prefix' => '',
'host' => '127.0.0.1',
'port' => '5432',
'namespace' => 'Drupal\\Core\\Database\\Driver\\pgsql',
'driver' => $dbopts['scheme'] === 'postgres' ? 'pgsql' : 'mysql',
@deltorosalazar
deltorosalazar / settings.php
Created April 28, 2019 05:10
Drupal 8 - Setting Up Config Directory
$config_directories['sync'] = '../config/sync';
@deltorosalazar
deltorosalazar / .sh
Created July 5, 2019 15:44
Make Git ignore file mode changes
git config core.fileMode false
find . -type d -exec chmod a+rwx {} \; # Make folders traversable and read/write
find . -type f -exec chmod a+rw {} \; # Make files read/write
@deltorosalazar
deltorosalazar / 7-1patt.sh
Last active July 20, 2019 16:18
Generate the 7-1 SASS Pattern scaffolding
mkdir sass; \
cd sass; \
mkdir base/ components/ layout/ pages/ themes/ utils/ vendors/; \
touch main.scss base/_reset.scss base/_typography.scss utils/_variables.scss; \
echo '@import "base/reset";' > main.scss \
echo '@import "base/typography";' > main.scss \
@deltorosalazar
deltorosalazar / killPort.sh
Created July 24, 2019 16:08
Kill process in a specific port
# To list any process listening to the port 8080
lsof -i:8080
# To kill any process listening to the port 8080
kill $(lsof -t -i:8080)
# To kill any process more violently
kill -9 $(lsof -t -i:8080)
@deltorosalazar
deltorosalazar / getInitialPropsHOC.js
Created September 24, 2019 02:58
Next.js - getInitialProps from a HOC
import React from 'react'
/*
* Higher order component that passes `getInitialProps` through
* to the child component
*/
const HOC = function(Child) {
return class Higher extends React.Component {
static getInitialProps(ctx) {
return Child.getInitialProps(ctx)
@deltorosalazar
deltorosalazar / config
Created June 11, 2024 03:14
Have multiple SSH keys
# /Users/<user>/.ssh/config
Host github.com-<foo>
HostName github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/<filename-1>
Host github.com-<bar>
HostName github.com