Skip to content

Instantly share code, notes, and snippets.

View kyleskrinak's full-sized avatar

Kyle Skrinak kyleskrinak

  • Gilead Sciences
  • Raleigh, NC
  • 04:51 (UTC -04:00)
View GitHub Profile
@kyleskrinak
kyleskrinak / make-drude-project.sh
Last active August 23, 2016 16:36
Creating a new Drude project directory
(( TODO: add php.ini file instructions ))
create directory off ~/Projects
dsh install drude
gsed -i -e "s/hello-world/<sitename>/g" docker-compose.yml # edit docker-compose.yml VIRTUAL_HOST to point to directory
# echo "192.168.10.10 $(basename $(pwd))" | sudo tee -a /etc/hosts # update /etc/hosts for new host --append on linux, -a on OSX. No longer needed
svn export https://github.com/blinkreaction/drude/trunk/examples/.drude #grabs the config files for php, mysql from drude project
drush dl drupal-7 --drupal-project-rename="docroot"
drush dl drupal-8 --drupal-project-rename="docroot"
dsh up
dsh bash cli and update composer inside shell session
@kyleskrinak
kyleskrinak / node.inc
Created November 22, 2015 12:02
Extends migrate_d2d's D7/node.inc
<?php
/**
* Common mappings for the Drupal 7 node migrations for Divinity.
*/
abstract class DivinityNodeMigration extends DrupalNode7Migration {
public function __construct(array $arguments) {
parent::__construct($arguments);
$this->addUnmigratedDestinations(array(
@kyleskrinak
kyleskrinak / person.inc
Last active November 22, 2015 12:12
This Drupal Migration_d2d class fails to import an entire node when the source node's body field is empty
<?php
/**
* Created by PhpStorm.
* User: kds38
* Date: 15/11/10
* Time: 4:20 PM
*/
class DivinityPersonMigration extends DivinityNodeMigration {
@kyleskrinak
kyleskrinak / get-main-menu.drush
Last active August 29, 2015 14:22
It's crude and rude, but all I need for now. Give me all links off the main menu, so that I can use the resulting link list for creating site crawlers for QA
#!/usr/bin/env drush
// let user pass menu machine name
$arg = drush_shift();
print ( $arg );
// assign a default menu name
if ( empty($arg) ) {
$arg = "main-menu";
}
@kyleskrinak
kyleskrinak / Installation output
Last active August 29, 2015 14:17
geektool 0.2a installation errors on MacOSX 10.10.2
> $ sudo python setup.py install [±master]
Password:
/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-14.3.1-py2.7.egg/setuptools/dist.py:282: UserWarning: Normalizing '0.2a' to '0.2a0'
running install
running bdist_egg
running egg_info
writing requirements to geeknote.egg-info/requires.txt
writing geeknote.egg-info/PKG-INFO
writing top-level names to geeknote.egg-info/top_level.txt
writing dependency_links to geeknote.egg-info/dependency_links.txt
@kyleskrinak
kyleskrinak / SassMeister-output.css
Last active August 29, 2015 14:14
Qualtrics form redo
html .CSS3 .Skin #LogoContainer{padding:1em 0 2em 0;-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1);border-bottom:1px solid #ddd}html .CSS3 .Skin #Logo{background-image:url(http://sites.duke.edu/techexpo/files/2015/01/TechExpo2015E.png)}.Skin .QuestionBody{margin:0}#Header:empty{display:none}#LogoContainer{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2YyZjJmMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color
@kyleskrinak
kyleskrinak / SassMeister-input.sass
Last active September 14, 2015 17:12
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
/* for the 2015 TechExpo Duke site
/* source: https://gist.github.com/kyleskrinak/ecbf27fcc5c74160c851
@import compass
#wpmu-footer-html
@kyleskrinak
kyleskrinak / move-git.sh
Last active August 29, 2015 14:12
My shell script move change the location of the .git repo from localsite/themes/themename/.git to localsite/.git Note that when this script is finished you'll have to manually move the directories accordingly.
#!/usr/bin/env bash
# set -x
# trap read debug
[[ $@ ]] || { echo "Please identify theme name" ; exit 1; }
if [ ! -d ".git" ]
then
echo "Y U no have .git directory?"
@kyleskrinak
kyleskrinak / change-field-length.php
Created November 4, 2014 20:01
This Drush php-script allows you to increase the length of a text field that you specify on line #28. This script can be updated to allow for a user to pass the field name and length as args. That's an exercise for another time. I got the code from this blog post: http://nathan.rambeck.org/blog/42-modify-drupal-7-text-field-maximum-length
<?php
/*
* Utility to change the max length of a text field
*/
function change_text_field_max_length($field_name, $new_length) {
$field_table = 'field_data_' . $field_name;
$field_revision_table = 'field_revision_' . $field_name;
$field_column = $field_name . '_value';
@kyleskrinak
kyleskrinak / cleanup.drush
Last active August 29, 2015 14:08
Removes all files that have no associated usage. Run as drush php-script cleanup.drush
#!/usr/bin/env drush
<?php
//db_query to find all files not attached to a node:
$result = db_query("SELECT fid FROM {file_managed} m WHERE NOT EXISTS (SELECT * FROM {file_usage} u WHERE m.fid = u.fid)");
echo $result->rowCount();
// how much did I delete?
$foundCounter = 0;