Skip to content

Instantly share code, notes, and snippets.

View jenlampton's full-sized avatar

Jen Lampton jenlampton

View GitHub Profile
@codeadamca
codeadamca / mamp-php-versions.md
Last active April 30, 2024 13:32
How to add new PHP versions to MAMP on a Mac

Adding Versions of PHP to MAMP on a Mac

If you're working on a project that requires a version of PHP higher than the versions that MAMP comes with, you can easily add additional verions.

My version of MAMP came installed with PHP 7.4.21 and 8.0.8. I'm attempting to use MAMP to host a Laravel application which requires at least PHP 8.1.

The version of PHP MAMP uses is often different than the version you have installed. I have installed PHP using Brew. I'm currently running PHP 8.1.8. If you want to check your installed version of PHP, use the terminal and run the following command:

php --version
@olafgrabienski
olafgrabienski / backdrop-translation-server-status-ideas.md
Created June 8, 2017 16:15
Building a Backdrop Translation Server, Status and Ideas

Building a Backdrop Translation Server, Status and Ideas

8th of June, 2017

Backdrop doesn't have a working translation server to provide non-English language files. Such language files are needed to run Backdrop as a multilingual or a localized website. As a workaround, Backdrop is linking to the Drupal translation server (https://localize.drupal.org) which has some drawbacks:

  • The link doesn't go to a specific page. Interested persons have to search the relevant language file of the latest Drupal core 7.x release.
  • The Drupal core language files don't catch up with the progress made by Backdrop:
    • Backdrop continues to include new language strings, or change existing ones.
  • Backdrop has integrated former Drupal contrib modules like Views, Pathauto, Token and more in Backdrop core. To get these language strings from the Drupal translation server, you have to look for the relevant module's language files.
@markbao
markbao / howto.md
Last active July 26, 2021 00:40
Matias Ergo Pro Mac keyboard: remap right-control (where "b" should be) to "b"

The Matias Ergo Pro keyboard has a control key where I usually type "b" (I type "b" with my right hand). Here's how to remap that key to a "b".

  1. Download Karabiner: https://pqrs.org/osx/karabiner/
  2. Install it
  3. Open the app and go to "Misc & Uninstall"
  4. Click "Open private.xml" to open the customization file
  5. Open "private.xml" in TextEdit
  6. Add the following:
  7. Save and go back to Karabiner
  8. Go back to the first tab, Change Key
@serundeputy
serundeputy / backdrop.druhs.inc
Created May 18, 2015 13:46
backdrop.drush.inc
<?php
function backdrop_bootstrap_candidates() {
return 'Drush\Boot\BackdropBoot';
}
@cafuego
cafuego / degithub
Last active August 29, 2015 13:57
Rewrite github generated HTML to Backdrop filtered HTML
#!/usr/bin/php
<?php
if ($_SERVER['argc'] == 2) {
$file = $_SERVER['argv'][1];
}
else {
$file = 'php://stdin';
}
$fp = fopen($file, 'r');
@juampynr
juampynr / mymodule.md
Last active July 16, 2022 23:41
Drupal 7 Database Updates tricks

This document contains a common database updates in Drupal 7 projects.

Change a field type from textarea to textfield (wipe out its data)

Let's suppose we want to change field_article_summary from text to textarea, but we do not care about loosing its current data.

Start by removing the field through the Admin Interface in your local environment. Then, add the field with the new configuration and recreate the feature where it was exported. Finally, add the following database update:

@karbassi
karbassi / index.html
Created August 12, 2013 23:34
Really small jQuery plugin to convert text with straight quotes to curly/smart quotes.
<!DOCTYPE html>
<head>
<title>Example</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<section class="what">
<div class="awesome">
<div class="classnames">
@jenlampton
jenlampton / gist:5647420
Last active December 17, 2015 17:39
New node template (and variables) for Twig in D8
<article id="node-{{ nid }}" class="clearfix {{ attributes.class }}"{{ attributes }}>
{{ title.prefix }}
{% if not page %}
<h2{{ title.attributes }}><a href="{{ url }}" rel="bookmark">{{ title.label }}</a></h2>
{% endif %}
{{ title.suffix }}
{% if display_submitted %}
<footer>