Skip to content

Instantly share code, notes, and snippets.

View rlnorthcutt's full-sized avatar
🇺🇦

Ron Northcutt rlnorthcutt

🇺🇦
  • Appsmith
  • Austin, TX
View GitHub Profile
@mortenson
mortenson / DrupalComponents.php
Last active August 4, 2019 14:50
Thinking about single file Drupal frontend components... Edit: Now live at https://drupal.org/project/sfc !
<?php
class SayHello implements ComponentInterface {
const name = 'sayhello';
const template = <<<TWIG
{% embed "@components/bigtext" %}
{% block content Hello {{ name }}! %}
{% endembed %}
@dantleech
dantleech / README.md
Last active October 21, 2021 21:22
PHPStan Drupal Integration
$ composer require phpstan/phpstan

Drupal dynamically adds to the class autoloader at runtime, so it is necessary to bootstrap Drupal in order that it is fully populated. Note that this may require that the database be accessible (i.e. may be problematic when working with Docker). This is why we use a custom autoload file below.

$ ./bin/phpstan analyse --level=7 -c phpstan.neon docroot/modules/custom
@cam8001
cam8001 / passwd_gen.sh
Last active June 7, 2017 13:50
Quick and dirty password generator for macOS
#!/bin/bash
# Generates readable, word based passwords with random numbers attached.
# Example pass: Foo73-bar22
# Passwords take 'centuries' to crack according to https://github.com/dropbox/zxcvbn
DICT_FILE='/usr/share/dict/words'
#DICT_FILE_LENGTH=`python -c "import sys;num_lines = sum(1 for line in open('/usr/share/dict/words'));print num_lines"`
DICT_FILE_LENGTH='235886'
RANDOM_NUM=`od -vAn -N4 -tu < /dev/urandom`
RANDOM_NUM2=`od -vAn -N4 -tu < /dev/urandom`
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@caschbre
caschbre / fix-permissions.sh
Created February 10, 2013 19:34
Bash script to correct folder & file permissions for a Drupal site. Usage: sudo bash fix-permissions.sh --drupal_path=your/drupal/path --drupal_user=your_user_name @see http://drupal.org/node/244924 for more information.
#!/bin/bash
if [ $(id -u) != 0 ]; then
printf "This script must be run as root.\n"
exit 1
fi
drupal_path=${1%/}
drupal_user=${2}
httpd_group="${3:-www-data}"
@msabramo
msabramo / git_prompt_info.zsh
Created April 11, 2012 00:07
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}