Skip to content

Instantly share code, notes, and snippets.

View frederickjh's full-sized avatar

Frederick Henderson frederickjh

  • Hawaiian Acres, HI USA
View GitHub Profile
@eugenesvk
eugenesvk / fish_shell_local_install.sh
Last active March 16, 2016 12:24 — forked from masih/fish_shell_local_install.sh
Installs Fish Shell without root access
# Bash script for installing Fish Shell on systems without root access
# Fish Shell will be installed in $HOME/local/bin
# It's assumed that wget and a C/C++ compiler are installed
set -e # exit on error
FISH_VER=2.2.0
mkdir -p $HOME/local $HOME/fish_shell_tmp # create our directories
cd $HOME/fish_shell_tmp
wget http://fishshell.com/files/${FISH_VER}/fish-${FISH_VER}.tar.gz # download source files for Fish Shell
@alexellison
alexellison / composer_cheat_sheet.md
Last active December 5, 2016 14:20
composer cheat sheet

List project info

composer show project/name

Example: composer show drush/drush

This will show version numbers, source (repo), dependencies, etc.

Site-local drush

Below quoted from https://pantheon.io/blog/avoiding-dependency-hell-site-local-drush

If you have already tried your hand at using Composer to add Drush to your Drupal 8 site, you may have noticed that your site-local Drush was placed in the vendor/bin directory inside of your Drupal root. You may be wondering whether you should put this directory in your $PATH, or what you should do if you have more than one Drupal 8 site on the same computer. Fortunately, Drush has already anticipated this problem for you and solved it. All that you need to do is update your global Drush—the one that is on your $PATH--to Drush 8.0.0-rc1 or later. Then, any time you run a Drush command, the global Drush will notice that there is a site-local Drush, and will use it instead.

#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Syncthing
# Description: Automatically sync files via secure, distributed technology
# Author: Typomedia Foundation
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-move_the_moderation_state_to_the_actions_region.php
Created March 17, 2015 21:59
Code from slide 49 of "Tailor your backend to meet the clients needs" - move the moderation state to the actions region
<?php
/** Text from slide 49 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* move the moderation state to the actions region
**/
$form['revision_information']['#collapsed'] = TRUE;
if (isset($form['revision_information']['workbench_moderation_state_new'])) {
$form['actions']['workbench_moderation_state_new'] = $form['revision_information']['workbench_moderation_state_new'];
unset($form['revision_information']['workbench_moderation_state_new']);
}
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-improve_the_url_selction_form.php
Created March 17, 2015 21:41
Code from slide 47 of "Tailor your backend to meet the clients needs" - Improve the URL selection form
<?php
/** Text from slide 47 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* Improve the URL selection form
**/
if (isset($form['#entity_type'])
&& $form['#entity_type'] == 'node'
&& isset($form['path'])
&& isset($form['path']['alias'])) {
unset($form['path']['#type']); // remove the fieldset
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-remove_items_from_vertial_tabs_and_add_to_another_fieldset.php
Created March 17, 2015 21:00
Code from slide 45 of "Tailor your backend to meet the clients needs" - remove items from vertical tabs, and add them to another fieldset
<?php
/** Text from slide 45 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* remove items from vertical tabs, and add them to another fieldset
**/
if (isset($form['#groups']['group_settings'])) {
$weight = 0;
foreach ($form as $key => $value) {
if(is_array($value) && isset($value['#group'])) {
unset($form[$key]['#group']);
@jpamental
jpamental / Drupal_IMG_WxH_Remove
Created January 10, 2015 23:28
Simple function to go in your template.php file to keep Drupal from inserting height/width into image tags.
function themename_preprocess_image(&$variables) {
foreach (array('width', 'height') as $key) {
unset($variables[$key]);
}
}
@hawkeyetwolf
hawkeyetwolf / drush-alias-remote-host-check.php
Last active April 4, 2016 22:16
Drush aliases: scrub "remote host" key for cross-environment use
<?php
/**
* @file
* Example drush alias file for multihost use.
*/
// Alias settings common to all.
$aliases['base'] = array(
'root' => '/var/www/docroot',
@KonradIT
KonradIT / README.md
Last active October 20, 2021 12:40
Missile

#Missile - PushBullet made awesome

Version 1.2

Missile is a PushBullet client for Ubuntu and other Linux operating systems. It supports:

  • Send note to all devices
  • Send link to all devices
  • Send list to all devices
  • Send image to all devices
@magicznyleszek
magicznyleszek / css-selectors.md
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {