This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$orgs = db_select('chado.organism', 'o') | |
->fields('o') | |
->execute(); | |
foreach ($orgs as $organism) { | |
$organism_id = $organism->organism_id; | |
$nid = chado_get_nid_from_id('organism', $organism_id); | |
$node = node_load($nid); | |
$links = $node->field_resource_links ?? NULL; | |
if ($links) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -ne 'if(/^>(\S+)/){$c=grep{/^$1$/}qw(sequence_name)}print if $c' file.fasta > out.fasta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DB_NAME="drupal" | |
DB_PASS="secret" | |
DB_USER="drupal" | |
ADMIN_PASS=secret | |
echo "Dropping DB: $DB_NAME" | |
sudo -u postgres dropdb $DB_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//if we made this into a module, we would use the tripal jobs... but we dont so its commented out for now. | |
// | |
//global $user; | |
//tripal_add_job( | |
// "Convert fields to properties", 'no_module', | |
// 'snippet_tripal_job_callback', | |
// 'chado_update_existing_node_urls', | |
// [], | |
// $user->uid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | grep -v "master" | xargs git branch -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### What are my densest indexes? | |
SELECT relname, relpages | |
FROM pg_class | |
ORDER BY relpages DESC; | |
### What are my running queries | |
ELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set search_path to chado; | |
create index if not exists dbxref_idx1 on dbxref (db_id); | |
create index if not exists dbxref_idx2 on dbxref (accession); | |
create index if not exists dbxref_idx3 on dbxref (version); | |
create index if not exists cvterm_idx1 on cvterm (cv_id); | |
create index if not exists cvterm_idx2 on cvterm (name); | |
create index if not exists cvterm_idx3 on cvterm (dbxref_id); | |
COMMENT ON INDEX cvterm_c1 IS 'A name can mean different things in'; | |
COMMENT ON INDEX cvterm_c2 IS 'The OBO identifier is globally unique.'; | |
create index if not exists cvterm_relationship_idx1 on cvterm_relationship (type_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"#": "cmap-js chinese chestnut configuration file", | |
"header": ": Chinese Chestnut Genetic map", | |
"attribution": "HWG", | |
"initialView": [ | |
{ | |
"source": "Chinese Chestnut Genetic Map", | |
"map": "A" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder