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
/** | |
* Changes value to past tense. | |
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
* http://jsfiddle.net/bryan_k/0xczme2r/ | |
* | |
* @param {String} value The value string. | |
*/ | |
Vue.filter('past-tense', function(value) { | |
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
var vowels = ['a', 'e', 'i', 'o', 'u']; |
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
# Image neeeds to have ssh-client | |
image: docker:git | |
services: | |
- docker:dind | |
stages: | |
- staging | |
before_script: | |
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY |
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
server { | |
listen [::]:80; | |
listen 80; | |
server_name app.example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { |
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
# By default, Docker containers run as the root user. This is bad because: | |
# 1) You're more likely to modify up settings that you shouldn't be | |
# 2) If an attacker gets access to your container - well, that's bad if they're root. | |
# Here's how you can run change a Docker container to run as a non-root user | |
## CREATE APP USER ## | |
# Create the home directory for the new app user. | |
RUN mkdir -p /home/app |
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
xmlp |
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
nginx-proxy: | |
image: 'jwilder/nginx-proxy' | |
ports: | |
- '80:80' | |
- '443:443' | |
volumes: | |
- '/path/to/certs:/etc/nginx/certs:ro' | |
- '/etc/nginx/vhost.d' | |
- '/usr/share/nginx/html' | |
- '/var/run/docker.sock:/tmp/docker.sock:ro' |
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
"""Python 3 script to get partial protein HGVS given NCBI dbSNP ID | |
Example: | |
$ python3 protein_hgvs_for_snp_id.py 334 | |
snp_id: | |
334 | |
gene: | |
{'name': 'HBB', 'gene_id': '3043'} | |
protein_change_hgvs: |
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
var http = require('http'); | |
var router = require('routes')(); | |
var Busboy = require('busboy'); | |
var AWS = require('aws-sdk'); | |
var inspect = require('util').inspect; | |
var port = 5000; | |
// Define s3-upload-stream with S3 credentials. | |
var s3Stream = require('s3-upload-stream')(new AWS.S3({ | |
accessKeyId: '', |
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
// At top, import immutable | |
import { Map } from 'immutable'; | |
// Later, in constructor... | |
this.state = { | |
// Create an immutable map in state using immutable.js | |
user: Map({ firstName: 'Cory', lastName: 'House'}) | |
}; | |
updateState({target}) { |
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
/* | |
* Valid options are: | |
* - chunk_read_callback: a function that accepts the read chunk | |
as its only argument. If binary option | |
is set to true, this function will receive | |
an instance of ArrayBuffer, otherwise a String | |
* - error_callback: an optional function that accepts an object of type | |
FileReader.error | |
* - success: an optional function invoked as soon as the whole file has been | |
read successfully |