Skip to content

Instantly share code, notes, and snippets.

View chip's full-sized avatar

Chip Castle chip

View GitHub Profile
@chip
chip / install-java.sh
Created June 11, 2018 19:53
HomeBrew Revert to Java8 from Java9
#!/usr/bin/env bash
set -e
# Uninstall Java 9 off the bat, so we can fix our local installation
if brew cask ls --versions "java" &>/dev/null; then
echo "Uninstalling Java"
brew cask uninstall java
fi
# Install jenv, java8 and java9
brew install jenv
brew cask install caskroom/versions/java8
@chip
chip / multiprocess_migration.sh
Created April 4, 2018 18:46 — forked from tanema/multiprocess_migration.sh
migrate files from gridfs to aws s3
#! /bin/bash
###################### USAGE ######################################
usage() {
echo "
Usage: mongotos3 [-t n] mongo_host mongo_collection s3_bucket
-t : number of parallel processes to use
mongo_host : the host of the mongodb server
mongo_collection : the collection to collecthe gridfs data from
s3_bucket : the name of the bucket you want to cp the files to
"
@chip
chip / sets.js
Created March 21, 2018 14:47 — forked from clohr/sets.js
ES6 Sets: Intersection, Difference, and Union
const a = new Set([1, 2, 3, 4, 4, 4])
const b = new Set([3, 4, 5, 6])
const intersect = (set1, set2) => [...set1].filter(num => set2.has(num))
const differ = (set1, set2) => [...set1].filter(num => !set2.has(num))
const joinSet = (set1, set2) => [...set1, ...set2]
const myIntersectedSet = new Set(intersect(a, b))
console.log('myIntersectedSet', myIntersectedSet)

IMPACT PLASTICS - EMAIL REMINDERS ESTIMATE

BACKGROUND

The BinTracker app currently has the ability to manage and log maintenance performed on waste containers. These waste containers are commonly referred to as "assets". BinTracker already includes functionality for listing assets and editing them individually.

SCOPE OF WORK

Implement an email reminder system for waste container assets of the BinTracker app.

@chip
chip / rnb.erb
Created May 29, 2017 16:32 — forked from romainl/_rnb.md
RNB, a Vim colorscheme template
<%
# RNB, A VIM COLORSCHEME TEMPLATE
# Author: Romain Lafourcade (https://github.com/romainl)
# Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca
# This template is designed to help vimmers create their own colorschemes
# without much effort.
#
# You will need Ruby to generate your colorscheme but Ruby knowledge is
# not needed at all.
@chip
chip / id_dsa.pub
Created May 15, 2017 23:51
public key (dsa)
ssh-dss AAAAB3NzaC1kc3MAAACBAKPhWAJ8noANjNrPHzaCUh//yRt621Fnna8Vp9aCu60F87YHDVO2pNYP9GEcy3iAbVJi+8mkVeptSkPBmt0DkUPX87iJntftGdOWDM5Ro30AYM01zA5scrLXYpfjPk0nagAqlcjx9HbOm8YQ2ukndWH/GegK7ctR8+iMwi2ObCuRAAAAFQDeJ5QeL0a3q5j7bTWInI2TSGIPdwAAAIEAoQ6R6C9lXKl6MpwF2WQUeO6viAWdvofpA0HGNP0lZEeZIWpvzEUY24UnRp8cpURM0sVIuQVCm3PKvxoDbEMuQlqcmAOQlQe8rixkD3tYN49gGYrLbMhNePGM52kgRmMfN3wwI6cWnjHKJix25Ln51Kog4yRrzxcO0ZZg41X6uzcAAACARoXO8XANCi/iDJx4ju6QsztscIrfjTmOwy0z2wyysJYDmVRgs8/+r2WHXJVxyTy7mhsBP+tEyoYdyXm5z8YtfYbCdRgjGk254/W8I3mA80Zok6X83BFdMM3pr8evtVSVU2Y9wcOL5RnW4hfZoIwIwWADWGG49HvBybP0lgVdRx0= chip@macbook
@chip
chip / id_rsa.pub
Last active May 16, 2017 00:16
Public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtHPqTt/S6Co0PF8swbMFusT6Z6saRSkE9Rw4lxwSc4gzbf/ckUt7Ofwk/zTtdtlzTNw/LoQsJnYEPKZxSJL2fWQkuqJZlrYc8nxfMcAR2ywk7Tr5q7RYP17Urpakh89NG1wT3WB/Q7Mc9bNnU3+xYCCMv7EpuMmi7p8SDA1g2vbtw2vBeopSaS9E6bgD0e7Z6e5Ah8DsrzNwNBo8keJYkc0+bt30i6y4ZhQoEjwoVf13KEeTAGoTAzwtiA64cxLsytVrSu5PhqIy2ZfBRXh5WmIVHyTdYZwdKnyT3g62Akw2PnpvxYSduM3CTAa8eHDOrKAmKbYK6RxyGpVxP/Cr9 [email protected]
@chip
chip / meteorHoc.js
Created April 25, 2017 00:34 — forked from rdickert/meteorHoc.js
Create single-prop HOCs for Meteor
// Creating Meteor HOCs
import { Meteor } from 'meteor/meteor';
import { createContainer } from 'meteor/react-meteor-data';
import React from 'react';
import { compose } from 'recompose';
// Assuming we have a Meteor collection here...
import TodosCollection from '../api/TodosCollection';
@chip
chip / Status.js
Created January 27, 2017 16:06
React component using styled-components
import React from 'react';
import { Row, Col } from 'react-bootstrap';
import styled from 'styled-components';
const RedRow = styled(Row)`
color: red;
`;
const Status = () => (
<div>
@chip
chip / toggl-bot-sample.js
Created December 12, 2016 22:39
Toggl Bot sample for Slack
// TOGGL is a web-based time-tracking service: http://toggl.com
import { togglApi, togglParser } from '../dist/togglApi'
const apiToken = process.env.TOGGL_API_TOKEN
// Request account profile from the Toggl API
togglApi({apiToken}).fetchData('/me')
.then(function(data) {
// Return your default workspace id so that we can then make calls for clients, projects, time entries, etc.