Skip to content

Instantly share code, notes, and snippets.

Kate Donaldson katelovescode

Block or report user

Report or block katelovescode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@katelovescode
katelovescode / jekyllgen.sh
Last active Aug 29, 2015
Jekyll Generator Bash Script - installs jekyll and therubyracer to a jekyllgen RVM gemset, generates a site based on project name and if provided a git remote repo, will add it as a remote
View jekyllgen.sh
#!/bin/bash
# flags are -n|--name -u|--url, both have required arguments if used
# if name and url are not entered as a flag, user will be prompted for them (but URL is optional)
# for ease of use, set up an alias in .bashrc - then just call "jekyllgen" from the parent folder of your project
TEMP=`getopt -o n:u: --long name:,url: -n 'test.sh' -- "$@"`
eval set -- "$TEMP"
ARG_N=
@katelovescode
katelovescode / policedepartment.txt
Last active Nov 12, 2016
Template for emailing the police department to ask about their action plan to protect against police brutality
View policedepartment.txt
Dear Chief [name],
My name is [name] and I am a resident of [city].
I’d like to start by commending you on the [program] the police department has implemented in [city]. I think this is a
fantastic step to maintain and improve trust between the police department and the community. I know Police Chief [name]
implemented it before his retirement, but I commend you on continuing the program. This, along with the support of the
Safe Haven law, indicate the PD’s willingness to decriminalize behaviors when those behaviors are truly able to be
addressed by compassion first.
View output_rake
01:46:20 kate ~/Projects/gems/postmachine (feature/create_a_post)*$ rake spec
/home/kate/.rvm/rubies/ruby-2.4.0/bin/ruby -I/home/kate/.rvm/gems/ruby-2.4.0@postmachine/gems/rspec-core-3.5.4/lib:/home/kate/.rvm/gems/ruby-2.4.0@postmachine/gems/rspec-support-3.5.0/lib /home/kate/.rvm/gems/ruby-2.4.0@postmachine/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
View gist:f1b701746a6a7e86d9e7dcfbefc7a511
"test": "nyc mocha --recursive --require test/setup.test.js --recursive --timeout 15000",
setup.test.js:
import 'jsdom-global/register';
const enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-15.4');
const chai = require('chai');
const sinon = require('sinon');
@katelovescode
katelovescode / select_appointment_dates
Last active May 22, 2018
Select appointment_dates where all dates are unconfirmed for a specific appointment
View select_appointment_dates
DROP TABLE IF EXISTS appointments;
CREATE TABLE appointments (
id integer,
title varchar(255),
created_at date
);
DROP TABLE IF EXISTS appointment_dates;
CREATE TABLE appointment_dates (
id integer,
@katelovescode
katelovescode / limited_api.rb
Created May 24, 2018
CSV output from a JSON API with a call limit
View limited_api.rb
require 'httparty'
require 'csv'
require 'json'
x = 0
while x < 46296 # this is the last record in my particular API
puts "on offset #{x}"
url = "http://api.dataatwork.org/v1/jobs?offset=#{x}&limit=500"
response = HTTParty.get(url)
jobs_only = response.parsed_response.select { |job| job["uuid"] != nil }
@katelovescode
katelovescode / .rubocop.yml
Created Jun 22, 2018
Rubocop configuration when using rubocop-rails gem
View .rubocop.yml
inherit_gem:
rubocop-rails:
- config/rails.yml
AllCops:
TargetRubyVersion: 2.5.1
DisabledByDefault: false
Exclude:
- "bin/**"
@katelovescode
katelovescode / get_marginalized_folks_in_tech.md
Last active Sep 19, 2019
Get Marginalized Folks in Tech and Keep Them There
View get_marginalized_folks_in_tech.md
@katelovescode
katelovescode / facebook.css
Last active Sep 16, 2018
User Stylesheet to stop Facebook from displaying chat windows
View facebook.css
# Use the User CSS Chrome extension, navigate to facebook, double click the User CSS icon to
# display the slide-out CSS window, and add the following code to the page so your Facebook
# messenger chat windows don't display
# https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb
#pagelet_dock, #pagelet_sidebar {
display: none;
}
@katelovescode
katelovescode / roman_numeral_converter.rb
Created Sep 7, 2018
Convert from Roman Numerals to Arabic
View roman_numeral_converter.rb
require "pry"
ROMAN_NUMBERS = {
"m": 1000,
"d": 500,
"c": 100,
"l": 50,
"x": 10,
"v": 5,
"i": 1
You can’t perform that action at this time.