Skip to content

Instantly share code, notes, and snippets.

View bradfordcondon's full-sized avatar

Bradford Condon bradfordcondon

View GitHub Profile
@bradfordcondon
bradfordcondon / drupal_commands.sh
Last active December 19, 2017 18:02
drush cheatsheet
#run database updates
drush updatedb
## Force a specific update to run
drush eval "module_load_install('tripal_elasticsearch'); tripal_elasticsearch_update_7201();"
drush dre [modulename] #disable, uninstall, re-install, enable module
docker volume ls #list all volumes
docker-compose up #start a container via docker compose
@bradfordcondon
bradfordcondon / Docker.sh
Last active December 6, 2017 18:51
Docker cheatsheet
#remove all images
docker rmi $(docker images -a -q)
#stop and remove all containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
#remove all volumes
docker volume rm $(docker volume ls -f dangling=true -q)
# List all images
docker images
@bradfordcondon
bradfordcondon / .sh
Created October 20, 2017 15:59
laradock
docker-compose up -d nginx mysql # bring up container with nginx and mysql
docker-compose exec workspace bash # enter workspace
docker-compose exec --user=laradock workspace bash # To have files created as the host's user, specify user = laradock
@bradfordcondon
bradfordcondon / REAMDE.md
Last active December 10, 2017 01:30
d3plot

Still under construction. Converting my v3 d3 plot to a bl.ock.

This plot demonstrates how to create a very simple grouped bar plot.

@bradfordcondon
bradfordcondon / REAMDE.md
Last active December 22, 2017 21:02
a very simple d3 plot
@bradfordcondon
bradfordcondon / test prefix.php
Created February 12, 2018 21:02
php unit testing connect to drupal
require_once '../includes/tripal_alchemist.api.inc';
use PHPUnit\Framework\TestCase;
use PHPUnit\DbUnit\TestCaseTrait;
//Change this path for the docker!
define('DRUPAL_ROOT', '/Users/chet/UTK/tripal');
$start = getcwd();
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
git rebase -i HEAD~4 # rebase branch back the number of commits
git commit --amend # make sure the commit message is awesome
git push origin branch-name --force # need to force the commits if you've already pushed
@bradfordcondon
bradfordcondon / AOtrigger.sql
Last active May 9, 2018 14:31
sql for creating a trigger for organism_analysis table to update when feature's organisms change.
CREATE TRIGGER check_ao_linker
AFTER INSERT ON feature
FOR ROW
EXECUTE PROCEDURE update_ao_linker();
CREATE TRIGGER check_ao_linker_update
AFTER UPDATE ON feature ON organism_id
FOR ROW
EXECUTE PROCEDURE update_ao_linker();
@bradfordcondon
bradfordcondon / cmap.json
Last active May 11, 2018 17:00
cmap.js for HWG trial
{
"#": "cmap-js chinese chestnut configuration file",
"header": ": Chinese Chestnut Genetic map",
"attribution": "HWG",
"initialView": [
{
"source": "Chinese Chestnut Genetic Map",
"map": "A"
},
{