Skip to content

Instantly share code, notes, and snippets.

@craic
craic / cleanup_gisaid.rb
Created April 11, 2020 15:51
Simple script to cleanup a FASTA file from the GISAID SARS-CoV-2 database
#!/usr/bin/env ruby
# cleanup_gisaid.rb
# Robert Jones jones@craic.com
# Freely distributed under the MIT licence
# This script takes a fasta format file from GISAID and fixes various data quality issues
# The vast majority of the sequences are fine but the few anomalies can cause problems downstream
# Database
add column 'sequence_type_tmp'
# Model
# original is :sequence_type_id (integer)
# add :sequence_type_tmp (string)
@craic
craic / tutorial_12_example_1.html
Last active December 27, 2015 12:49
Use the highcharts.js JavaScript library to display a graph in a page
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="width: 800px; height: 400px; margin: 0 auto; border: 1px solid black;"></div>
<script>
$(function () {
$('#container').highcharts({
title: {
text: 'Registered Syrian Refugees',
@craic
craic / tutorial_11_demo_1.html
Last active July 2, 2022 00:07
Embed a public Google Calendar in a web page
<iframe src="https://www.google.com/calendar/embed?height=400&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=craic.com_6kse7orlp11vp8ihln18ks2pd0%40group.calendar.google.com&amp;color=%232952A3&amp;ctz=America%2FLos_Angeles"
style=" border-width:0 " width="600" height="400" frameborder="0" scrolling="no"></iframe>
@craic
craic / tutorial_102_example_1.html
Last active December 27, 2015 10:39
Add a tweet button to a page
https://dev.twitter.com/docs/tweet-button
https://dev.twitter.com/docs/follow-button
https://twitter.com/about/resources/buttons
@craic
craic / tutorial_101_example_1.html
Created November 5, 2013 01:01
Create and embed a Google Translation widget in your Site
<meta name="google-translate-customization" content="4806411522697689-509906d560eaef8c-gf036ed82ad694b19-e"></meta>
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- https://translate.google.com/manager/website/suggestions -->
<!-- tied to specific web sites - so you need a google account etc. -->
@craic
craic / tutorial_10_example_1.html
Last active December 27, 2015 10:29
Embed a Bing Map in a web page
<div>
<iframe width="500" height="400" frameborder="0"
src="http://www.bing.com/maps/embed/viewer.aspx?v=3&cp=48.858601~2.293980&lvl=15&w=500&h=400&sty=r&typ=d&pp=&ps=&dir=0&mkt=en-us&src=SHELL&form=BMEMJS">
</iframe>
<div style="margin: 12px 0 0 0;">
<a target="_blank" href="http://www.bing.com/maps/?cp=48.858601~2.293980&sty=r&lvl=15&sp=&mm_embed=map">View Larger Map</a>&nbsp; |&nbsp;
<a target="_blank" href="http://www.bing.com/maps/?cp=48.858601~2.293980&sty=r&lvl=15&rtp=~pos.48.858601_2.293980____&mm_embed=dir">Get Directions</a>&nbsp; |&nbsp;
<a target="_blank" href="http://www.bing.com/maps/?cp=s48sq3h5r1fn&sty=b&lvl=18&sp=&mm_embed=be">View Bird's Eye</a>
</div>
@craic
craic / tutorial_9_example_1.html
Last active December 27, 2015 10:19
Embed a video from Vimeo in a web page
<iframe src="//player.vimeo.com/video/49643332" width='500' height='281' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
@craic
craic / tutorial_8_example_1.html
Last active December 27, 2015 09:48
Use Google fonts in a web page
<style>
@import url(http://fonts.googleapis.com/css?family=PT+Sans);
@import url(http://fonts.googleapis.com/css?family=Cinzel);
@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed);
@import url(http://fonts.googleapis.com/css?family=Fondamento);
p {
font-size: 18px;
}
.font1 {
@craic
craic / tutorial_7_example_1.html
Created November 2, 2013 00:08
Embed a live updating Twitter Timeline into a web page
<a class="twitter-timeline" href="https://twitter.com/BBCWorld" data-widget-id="395313647477481472">Tweets by @BBCWorld</a>
<script>
!function(d,s,id){
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+"://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);