Skip to content

Instantly share code, notes, and snippets.

View anaerobeth's full-sized avatar

Beth Tenorio anaerobeth

  • Healthie
  • Salem, NH
View GitHub Profile
{
"id": "foo",
"name": "bar
"publisher": "baz
"compose": {
"include": [
{
"system": "urn:oid:2.16.840.1.113883.3.8.287.41",
"concept": [
{

Bonfire section

Reverse a string str:

str.split().reverse().join();

Factorialize a number:

@anaerobeth
anaerobeth / calculate_quantiles.r
Created August 12, 2015 14:47
calculate quantiles in R
# launch R console from Mac Spotlight
# navigate to file directory
setwd("/Users/Tenorio/Desktop")
# load the file 'times.txt' in table format
counts <- read.table('times.txt')
# check if the file is read properly
# V1 is the default column name if no column title is specified
C00002PMS LILO-AN
C00005PMS LILO-AN
C00006PMS LILO-AN
C00007PMS TALIBON
C00008PMS TALIBON
C00009PMS TALIBON
C00010PMS LAPU-LAPU
C00012PMS LAPU-LAPU
C00013PMS LILO-AN
C00015PMS LAPU-LAPU
C00006PMS VOLUTIDAE
C00006PMS VOLUTIDAE
C00006PMS VOLUTIDAE
C00017PMS TURRIDAE
C00017PMS TURRIDAE
C00017PMS TURRIDAE
C00029PMS TURRIDAE
C00034PMS TURRIDAE
C00034PMS TURRIDAE
C00034PMS TURRIDAE

From SQL to Neo4j: Northwind

SQL Model

Neo4j Model

Get the SQL Dump

The SQL dump was stolen from here and imported into MySQL.

@anaerobeth
anaerobeth / es6-objectives.md
Created February 24, 2015 21:28
ES6 Night agenda

ES 6 Learning Objectives

For Tuesday

  • tools (editor plugins, browser extensions, syntax checker)
  • video links
  • books, documentations, slides, and blogs
  • examples, especially for rails developers

For Thursday

!!! Strict
%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
%head
%meta{'http-equip' => 'Content-Type', :content => 'text/html; charset=utf-8'}
%meta{:name => 'viewport', :content => 'widt=device-width, initial-scale=1.0'}
%title= subject
:css
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
{
"timeline": {
"headline": "Emily",
"type": "default",
"text": "A Timeline",
"startDate": "1922,10,30",
"date": [
{
"startDate": "2012,11,17",
"endDate": "2012,11,17",
require 'net/http'
require 'xmlsimple'
url = "http://www.user-agents.org/allagents.xml"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
data = XmlSimple.xml_in(xml_data)
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")}
agent_names = agents.collect {|agent| agent["String"].first}