Skip to content

Instantly share code, notes, and snippets.

import * as R from 'ramda';
/*
* DHSI 2019, Day 1 Exercises
*
* Here are a few programming challenges that ask you to write some functions
* using what we learned in class today. All of these can be solved without
* using Ramda, but they can also be solved more easily using Ramda's functions.
*
* You may need to consult Ramda's documentation (https://ramdajs.com/docs/) to
@oncomouse
oncomouse / LongestWord.js
Created June 5, 2019 14:17
DHSI 2019 - Day 2 Exercise Solutions
import React, { useState } from 'react';
import { longestWord } from './day01/exercises';
const LongestWord = () => {
const [words, setWords] = useState('');
const onChange = (event) => setWords(event.target.value);
return (
<div>
@oncomouse
oncomouse / App.js
Created June 4, 2019 23:45
DHSI 2019 - Day 2 Working Code
import React, { useState } from 'react';
import Headline from './components/Headline';
import NameForm from './components/NameForm';
import Names from './components/Names';
const App = () => {
const [names, setNames] = useState([])
return (
<div>
@oncomouse
oncomouse / StyledTransition.js
Last active April 15, 2021 05:24
Using CSSTransitionGroup with Emotion.js
import React from 'react';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { CSSTransition } from 'react-transition-group';
const has = (key, obj) => Object.prototype.hasOwnProperty.call(obj, key);
const keyframes = [
'appear',
'enter',
cask_args appdir: '/Applications'
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/cask-fonts"
# Shell stuff
brew "fish"
cask_args appdir: '/Applications'
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/cask-fonts"
# Shell stuff
brew "fish"
@oncomouse
oncomouse / readme.md
Created January 20, 2018 16:42
Amodern Code Figures
function sayHello(name) {    
     return ‘Hello there,  + name;
}
function sayHello(name) {
    name = name || ‘default person’;
 return ‘Hello there,  + name;
@oncomouse
oncomouse / index.html
Last active January 17, 2021 17:42
Simple Tracery Demo Template
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>
Page Title
</title>
@oncomouse
oncomouse / fix.rb
Created April 30, 2017 14:56
Script to fix permissions issues caused by a student IT worker running `chmod -R 755` in my OSX home directory
require 'shellwords'
# Dir.glob was acting weird w/ spaces in file names, so just used find:
IO.popen("find Old\\ Home/apilsch/ -type f") do |fp|
while not (output = fp.gets).nil?
# Full file path:
file = "/Users/apilsch/Desktop/#{output.strip}"
# Location of original file on disk:
disk_file = file.sub("Desktop/Old\ Home/apilsch/", "")
next if not File.exist? disk_file
@oncomouse
oncomouse / points.csv
Created June 2, 2015 22:32
Using Mechanize to Populate Neatline w/ Geocoded Information
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 7 columns, instead of 4. in line 8.
location,date,type,point,lat,lon,voyage
"12 Fulton St, New York, NY",10/19/1843,Port of Embarkation,POINT(-8238040.262471187 4969156.247075499),40.7065671,-74.0035748,0
"Merseyside L3 4BB, Liverpool, UK",11/1/1843,Port of Disembarkation,POINT(-333333.99225396814 7057466.066808143),53.400715,-2.9943902,0
"Bristol Harbour, Bristol, England",4/8/1838,Shipyard Location,POINT(-290859.72885313287 6701227.851099645),51.44969200000001,-2.6128374,0
"Merseyside L3 4BB, Liverpool, UK",1/4/1845,Port of Embarkation,POINT(-333333.99225396814 7057466.066808143),53.400715,-2.9943902,1
"Boston, MA",1/24/1845,Port of Disembarkation,POINT(-7910238.3479711665 5215071.602551562),42.3600825,-71.0588801,1
"Bay of Quick, Greenock, Scotland",1/4/1845,Shipyard Location,POINT(-531214.7175602124 7549756.132135566),55.95647599999999,-4.771983,1
"12 Fulton St, New York, NY",6/27/1855,Port of Embarkation,POINT(-8238040.262471187 4969156.247075499),40.7065671,-74.0035748,2
"Merseyside L3 4BB, Liverpool, UK",7/10/1855,Port of Disembarkation,