Skip to content

Instantly share code, notes, and snippets.

@FlorianBouron
FlorianBouron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active April 6, 2023 16:55
How to configure multiple deploy keys for different private github repositories on the same computer

This is probably a common issue for people who wants to deploy serveral repository on one VPS or VM.

This is not going to be rocket science.

The first step is to generate your first ssh key, for this type the following command line in your terminal: ssh-keygen -t rsa -b 4096 -C "your@email.com" When the command CLI is asking you if you want to use a passphrase you might want to press ENTER in order to don't have to type it everytime you will want to pull your repository.

Now copy the content of your public key and add it to Github in your first repository (Settings > Deploy keys). For example on debian it might be:

@bojanz
bojanz / extension-patterns.md
Last active January 14, 2023 16:59
Extension patterns: events, tagged services, plugins

This documentation is destined for drupal.org. Created first as a gist to make initial comments easier. Rewrites and clarifications welcome. Code samples are simplified for clarity. Perhaps a bit too much?

When talking about extensibility, there are several distinct use cases:

  1. Reacting to an action that has already happened.

The reaction can be anything; outputting a message, sending an email, modifying a related object, etc. Examples:

  • "A node has been saved"
  • "A product has been added to the cart".
@rwjblue
rwjblue / application.controller.js
Created December 14, 2015 18:07 — forked from barneycarroll/application.controller.js
Can't access object values by dynamic key in Handlebars
import Ember from 'ember';
export default Ember.Controller.extend({
numbers:['1','2','3','4'],
letters:['a','b','c','d']
});
@manfromanotherland
manfromanotherland / formspree.html
Last active July 30, 2021 07:05
JS: Ajax send forms using the most excellent Formspree » http://formspree.io #snippet
<form id="contact-form" action="//formspree.io/your@email.com" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="email@cc.com">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
@adamlogic
adamlogic / compass_and_css_sprites.md
Created September 1, 2012 15:26
Compass and CSS Sprites, Explained

Compass and CSS Sprites, Explained

Last week I attempted to use the CSS sprites feature of Compass for the second or third time. It's been a struggle each time, but the power and potential is there, so I keep coming back. This time was a bit different, though, because I finally decided to stop relying on the docs and dive into the code.

Before I go into the nitty-gritty, let's take a step back and talk about why I

@jamesarosen
jamesarosen / ember-xss.md
Created October 28, 2015 16:50
Ember and XSS Safety

TL;DR

In Ember, always use {{...}}, not {{{...}}}. Use Ember.String.htmlSafe as necessary in JavaScript (usually in a component) to mark markup as HTML-safe. Never pass user-entered content directly to Ember.String.htmlSafe.

Details

Ember has great XSS protection built in. The HTMLBars templating library will automatically run any interpolations through htmlEscape for you. So

@steffenr
steffenr / id_map_custom.php
Created January 29, 2018 07:23
[Drupal 8] Override id map with custom plugin for migrations
<?php
/**
* Implements hook_migration_plugins_alter().
*/
function my_module_migration_plugins_alter(array &$migrations) {
foreach ($migrations as $id => $configuration) {
if (!empty($migrations[$id]['idMap'])) {
// Do not override existing values.
continue;
@vivianspencer
vivianspencer / gist:656c8eee367f44e4742192c7e56e39f8
Last active December 21, 2018 09:07
Drupal 8 Get allowed values of field
$values = FieldConfig::loadByName('node', 'BUNDLE', 'FIELD')->getSetting('allowed_values');
@jonhattan
jonhattan / tmux.md
Last active March 9, 2018 11:03
tmux quickstart

tmux quickstart

$ tmux

CTRL+B C -> create new pane

CTRL+B [num] -> go to a pane

CTRL+D -> finish bash session, closes the pane. Closing all panes will destroy the window and thus the tmux

@geraldvillorente
geraldvillorente / icon.txt
Last active August 17, 2017 11:40
Creating custom plugin for Ckeditor.
// Location: ckeditor_plugins/qna/icons
This is where you put the plugin icon.