Skip to content

Instantly share code, notes, and snippets.

View illepic's full-sized avatar

Christopher Bloom illepic

View GitHub Profile
@illepic
illepic / brew_install_composer.sh
Last active September 12, 2016 15:58
Homebrew install Composer
brew tap homebrew/php
brew install homebrew/php/composer
@illepic
illepic / file_rel_path_d8.php
Last active August 23, 2023 09:40
Get relative path for fid in Drupal 8
<?php
use Drupal\file\Entity\File;
// public://images/blah.jpg
$drupal_file_uri = File::load($fid)->getFileUri();
// /sites/default/files/images/blah.jpg
$image_path = file_url_transform_relative(file_create_url($drupal_file_uri));
@illepic
illepic / upgrade_d6_taxonomy_term_classes.yml
Last active June 6, 2016 06:40
In a Drupal 6 or Drupal 7 migration to Drupal 8, use the embedded_data migration source plugin to import inline, one-off data. Use this to, say, create new taxonomy terms in a vocabulary. Note the use of the "data_rows" and "ids" keys in the source. "term_name"s are being added to the vocabulary "classes" via the "default_value" process plugin.
langcode: en
status: true
dependencies: { }
id: upgrade_d6_taxonomy_term_classes
migration_tags:
- 'Drupal 6'
migration_group: migrate_drupal_6
label: 'Taxonomy terms for WoW character classes '
source:
plugin: embedded_data
@illepic
illepic / private-github-release-download.sh
Last active January 2, 2024 09:43
Download the latest release binary from a private GitHub repo. (i.e. a .tar.gz that you have manually uploaded in a GitHub release). Update OAUTH_TOKEN, OWNER, REPO, FILE_NAME with your custom values.
#!/usr/bin/env bash
# Authorize to GitHub to get the latest release tar.gz
# Requires: oauth token, https://help.github.com/articles/creating-an-access-token-for-command-line-use/
# Requires: jq package to parse json
# Your oauth token goes here, see link above
OAUTH_TOKEN="34k234lk234lk2j3lk4j2l3k4j2kj3lk"
# Repo owner (user id)
OWNER="your-user-name"
---
# `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7,
# geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc.
vagrant_box: geerlingguy/centos7
vagrant_user: vagrant
vagrant_synced_folder_default_type: nfs
# If you need to run multiple instances of Drupal VM, set a unique hostname,
# machine name, and IP address for each instance.
vagrant_hostname: downfall.dev
@illepic
illepic / config.yml
Created December 26, 2015 21:21
Working Drupal VM config.yml for CentoOS7, PHP7, nginx, redis
---
# `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7,
# geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc.
vagrant_box: geerlingguy/centos7
vagrant_user: vagrant
vagrant_synced_folder_default_type: smb
# If you need to run multiple instances of Drupal VM, set a unique hostname,
# machine name, and IP address for each instance.
vagrant_hostname: downfall.dev
@illepic
illepic / vagrant18-win10.sh
Created December 25, 2015 09:24
Output from vagrant up --debug on vagrant 1.8.1, win10
F:\dev\puphpet-shit\UNzZYB
λ vagrant up --debug
INFO global: Vagrant version: 1.8.1
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.8.1\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
@illepic
illepic / vagrant-1.8.0.sh
Created December 24, 2015 19:03
Output of vagrant up --debug on vagrant 1.8.0 for the Drupal VM project (as far back as my terminal buffer will go)
INFO interface: info: Booting VM...
INFO interface: info: ==> drupalvm: Booting VM...
==> drupalvm: Booting VM...
INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "startvm", "5862800b-831e-4fc1-81b3-a934404e25b8", "--type", "headless"]
INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: Waiting for VM "5862800b-831e-4fc1-81b3-a934404e25b8" to power on...
VM "5862800b-831e-4fc1-81b3-a934404e25b8" has been successfully started.
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31998
DEBUG subprocess: Exit status: 1
var Model = (function() {
console.log('model');
})();
var View = (function() {
console.log("I am module 1");
})();
var AuthCheck = (function() {
return {
files_match:
avdfm_upfg216ln0n9:
path: \.php$
sethandler: 'proxy:fcgi://127.0.0.1:9000'
custom_fragment: ''
provider: filesmatch
php:
install: '1'
settings: