Skip to content

Instantly share code, notes, and snippets.

View ccjjmartin's full-sized avatar

Chris Martin ccjjmartin

View GitHub Profile
@ModulesUnraveled
ModulesUnraveled / Semantic vs. Primitive Variable Names.md
Last active December 28, 2022 21:59
Examples of why to use Semantic variable names

We read our code far more than we write it, so plan accordingly.

Even if you don't plan on anyone reading your code, chances are someone will... even if it's you 12 months from now.

Why we use "semantic" variable names rather than "primitive" names.

What do we mean by "Primitive" names?

Primitive names typically call the thing what it is. Some examples are:

@AaronFeledy
AaronFeledy / .lando.yml
Last active February 5, 2021 10:45
Example .lando.yml with Platform.sh and Drupal 8 / Gatsby Monorepo
name: myapp
# Start with the Drupal 8 recipe
recipe: drupal8
# Configure the D8 recipe to match up closer to a vanilla platform.sh stack
config:
# Lando defaults to Apache. Switch to nginx to match Platform.sh.
via: nginx
# Set the webroot to match .platform.app.yaml.
@mirzu
mirzu / circle.yml
Last active June 24, 2017 17:57
CircleCi 2.0 config for creating Multidev enviroments from a Github PR
version: 2
jobs:
build:
docker:
- image: notnoopci/php:7.1.5-browsers
working_directory: ~/wordpress
steps:
- add_ssh_keys
- run:
name: Install Terminus
@froboy
froboy / getsite.txt
Created June 28, 2016 14:49
Grab an entire static archive of a site with wget
// Before you can do this, get http://brew.sh/
// Then get wget: brew install wget
//
// Grab an entire static archive of a site. (This might take a while)
wget -mkEpnp http://sitename.com
@swichers
swichers / d7-add-entity-view-mode.md
Last active October 18, 2019 21:13
Drupal 7 - Programmatically add view mode to entity

In a module file:

This will enable an additional view mode for use on the specified entity type(s). Many examples will show the custom settings here being set to TRUE. If TRUE is used then that view mode is added to all entities of the specified type regardless of if it should be on the bundle or not.

/**
 * Implements hook_entity_info_alter().
 */
function HOOK_entity_info_alter(&$entity_info) {
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: