Skip to content

Instantly share code, notes, and snippets.

View jasonglisson's full-sized avatar

Jason Glisson jasonglisson

View GitHub Profile
@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.
@bryanbraun
bryanbraun / reset_hook_post_update_NAME.drush
Created June 19, 2017 20:24
A drush script for reseting post_update hooks. For more details, see https://drupal.stackexchange.com/q/238682/11788
#!../vendor/bin/drush
// <?php
// ^^^ For syntax highlighters only
//
// This is a drush shell script, designed to help debug and reset post_update
// hooks. For details, see: http://www.drush.org/en/master/shellscripts/
$key_value = \Drupal::keyValue('post_update');
$update_list = $key_value->get('existing_updates');
function THEMENAME_theme_suggestions_block_alter(array &$suggestions, array $variables) {
if (isset($variables['elements']['content']['#block_content'])) {
$suggestions[] = 'block__' . $variables['elements']['content']['#block_content']->bundle();
}
}
@tbranyen
tbranyen / _usage.md
Last active April 19, 2024 12:24
OpenWeatherMap / Weather Icons integration
  1. Include Weather Icons in your app: https://github.com/erikflowers/weather-icons

  2. Include the below JSON in your application, for example purposes, lets assume it's a global named weatherIcons.

  3. Make a request to OpenWeatherMap:

req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@vratiu
vratiu / .bash_aliases
Last active April 22, 2024 01:54
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@prwhite
prwhite / Makefile
Last active April 4, 2024 19:01
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@jimmynotjim
jimmynotjim / _instructions.md
Last active April 19, 2024 05:26
Setup macOS 12 Monterey

Leaving this for historical reasons, but with the latest iteration I set up proper dotfiles. Check em out

Setup macOS with a Clean Install

After too many years of tinkering my machine is a bit all over. With Mojave High Sierra Montery I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

@dtateii
dtateii / Package up an FTP Deployment
Last active April 21, 2016 20:45
Recursively copy changed files between two Git tags (or commits) to another location.
git diff --name-only v0.3 v0.4 | xargs -I{} rsync -Rv "{}" ~/Desktop/destination-dir/
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "