Skip to content

Instantly share code, notes, and snippets.

View peterk87's full-sized avatar

Peter Kruczkiewicz peterk87

  • Canadian Food Inspection Agency
  • Canada
View GitHub Profile
@peterk87
peterk87 / Comments.tmPreferences
Created April 24, 2013 15:33
XML: Sublime Text 2 C# toggle comment/uncomment save in Sublime Text 2/Packages/C#
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.cs</string>
<key>settings</key>
<dict>
@peterk87
peterk87 / interpolate_colors.cs
Created April 24, 2013 15:36
C#: Interpolate between 2 colors - 2 different approaches taken from StackOverflow.com
// Interpolate between 2 colors in C#
// Taken from answer by user Jason
// http://stackoverflow.com/questions/1236683/color-interpolation-between-3-colors-in-net
class ColorInterpolator {
delegate byte ComponentSelector(Color color);
static ComponentSelector _redSelector = color => color.R;
static ComponentSelector _greenSelector = color => color.G;
static ComponentSelector _blueSelector = color => color.B;
public static Color InterpolateBetween(
@peterk87
peterk87 / CGF_report_manual.tex
Last active December 16, 2015 15:09
LaTex: CGF report creator manual
\documentclass{article}
\usepackage{lineno}
\usepackage{url}
\usepackage{hyperref}
\usepackage{fancyhdr} % Needed to define custom headers/footers
\usepackage{titlesec}
\usepackage{lastpage} % Used to determine the number of pages in the document (for "Page X of Total")
@peterk87
peterk87 / ncix.css
Created April 26, 2013 04:42
CSS: NCIX.com dark theme
/*dark theme CSS for NCIX.com*/
div, table, b, td, tr, form, h1, h2, h3, h4, h5, input, select, span {
background: none !important;
}
div, table, b, td, tr, form, h1, h2, h3, h4, h5, textarea, input, select, span {
color: rgb(170,170,170) !important;
background-color: rgb(30,30,30) !important;
}
@peterk87
peterk87 / mist_2013.bib
Created April 26, 2013 17:37
bibtex: MIST reference
@article{kruczkiewicz_mist,
title = {{MIST}: a tool for rapid \emph{in silico} generation of molecular data from bacterial genome sequences},
author = {Kruczkiewicz, Peter and Mutschall, Steven and Barker, Dillon and Thomas, James and Van Domselaar, Gary and Gannon, Victor P.J. and Carrillo, Catherine D. and Taboada, Eduardo N.},
year = {2013},
location = {Barcelona, Spain},
pages = {316--323},
isbn = {978-989-8565-35-8},
publisher = {SCITEPRESS},
journal = {Proceedings of Bioinformatics 2013: 4th International Conference on Bioinformatics Models, Methods and Algorithms}
}
@peterk87
peterk87 / Bibliography.bib
Created April 26, 2013 17:39
bibtex: Massive bibliography used in MSc thesis
@article{olson_limited_2007,
title = {Limited genetic diversity in \emph{{Salmonella enterica}} Serovar {Enteritidis} {PT13}},
volume = {7},
copyright = {2007 Olson et al; licensee {BioMed} Central Ltd.},
issn = {1471-2180},
url = {http://www.biomedcentral.com/1471-2180/7/87/abstract},
doi = {10.1186/1471-2180-7-87},
abstract = {Salmonella enterica serovar Enteritidis has emerged as a significant foodborne pathogen throughout the world and is commonly characterized by phage typing. In Canada phage types ({PT)} 4, 8 and 13 predominate and in 2005 a large foodborne {PT13} outbreak occurred in the province of Ontario. The ability to link strains during this outbreak was difficult due to the apparent clonality of {PT13} isolates in Canada, as there was a single dominant pulsed-field gel electrophoresis ({PFGE)} profile amongst epidemiologically linked human and food isolates as well as concurrent sporadic strains. The aim of this study was to perform comparative genomic hybridization ({CGH)}, {DNA} sequen
@peterk87
peterk87 / stack_trace.R
Created April 26, 2013 20:42
R: track down errors that come primarily from non-interactive R sessions; prints a stack trace and continues on
# Printing stack trace and continuing after error occurs in R
# http://stackoverflow.com/questions/1975110/printing-stack-trace-and-continuing-after-error-occurs-in-r
# Bob Albright
# I wrote this code about a week ago to help me track down errors that come primarily from non-interactive R sessions. It's still a little rough, but it prints a stack trace and continues on. Let me know if this is useful, I'd be interested in how you would make this more informative. I'm also open into cleaner ways to get this information.
options(warn = 2, keep.source = TRUE, error =
quote({
cat("Environment:\n", file=stderr());
# TODO: setup option for dumping to a file (?)
@peterk87
peterk87 / navbar.html
Created April 29, 2013 16:32
HTML: R Shiny app navigation bar
<style type="text/css">body { padding-top: 25px;}</style>
<div class="navbar navbar-fixed-top navbar-inverse" id="tool" data-nav-value="dataview">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="#" data-value="dataview">Navigation bar title for whatever app!</a>
<div class="nav-collapse">
<ul class="nav">
<li><a href="#" data-value="dataview">View</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">EDAT<b class="caret"></b></a>
@peterk87
peterk87 / feedly_dark.css
Created April 29, 2013 23:58
CSS: feedly.com dark theme
/*feedly.com dark CSS theme*/
.placeholder{
visibility: hidden !important;
}
.area,.summary, div, .light {
background-color: rgb(30,30,30) !important;
color: rgb(200,200,200) !important;
}
a {
color: #78B7F5 !important;
@peterk87
peterk87 / coursera_dark.css
Created May 1, 2013 03:32
CSS: Coursera dark CSS style
/*coursera dark CSS style*/
/*URL on domain: coursera.org*/
a {
color: rgb(140, 178, 228) !important;
}
body,.row-fluid .span9,.row-fluid .span3,.row-fluid, div, li, ul, ol, .course-navbar-list .course-navbar-item.active a {
background-color: rgb(31, 31, 31) !important;
color: rgb(170,170,170) !important;
}