This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# group by x | |
# def time(a_proc) | |
# start = Time.now | |
# a_proc.call | |
# puts Time.now - start | |
# end | |
# | |
# time(Proc.new { code_here }) | |
# time(Proc.new { more_code_here }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thing1 = { data: 'data1', size: 10 } | |
thing2 = { data: 'data2', size: 20 } | |
thing3 = { data: 'data3', size: 5 } | |
require 'time' | |
require 'ap' | |
class Cache | |
def initialize(size:) | |
@size = size | |
@things = [] | |
@locations = {} # key: @things pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class TicTacToe | |
class SpotTaken < StandardError | |
end | |
SIZE = 3 | |
DEFAULT = '-' | |
def initialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# frozen_string_literal: true | |
require 'yaml' | |
to_find = ARGV[0] | |
puts "Finding #{to_find}" | |
parts = to_find.split('.') | |
filename = 'config/locales/en.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Design & implement an API that allows us to offload work into a queue, as well | |
# as consume and complete jobs on the queue. The API should provide the following | |
# functionality: | |
# | |
# 1) enqueue a job, which would consist of a job type and parameters | |
# | |
# 2) register something to handle jobs of a specific type | |
# (e.g. this could be a callback or class) | |
# | |
# 3) execute all jobs in the queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.gradleplugin | |
import com.google.common.io.Resources | |
import org.ajoberstar.grgit.Grgit | |
import java.nio.charset.Charset | |
class PreCommitHooks { | |
public static final String HOOK_PATH = '.git/hooks/' | |
public static final String COMMIT_MSG_HOOK_PATH = HOOK_PATH + 'commit-msg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
files_with_flow=`grep -r @flow web-src/src | wc -l | sed 's#^ *##g'` # sed removes leading whitespace | |
total_js_files=`find web-src/src -name *.js -type f | wc -l | sed 's#^ *##g'` | |
echo "Files with flow: "$files_with_flow | |
echo "Total js files: "$total_js_files | |
source previous_flowify_counts.sh | |
echo "Previous percentage flowified: "$PREVIOUS_FLOWIFY_PERCENTAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Even though some of these questions don't affect me directly, I consider them excellent indicators of whether a company is somewhere that I want to work at, because I would not like to work at a place where I wouldn't be able to be proud of. | |
(In approximate order of liklihood that a company will make me sad) | |
Does the company offer trans healthcare? How do you stack up against the https://www.hrc.org/hei/hei-scoring-criteria checklist? | |
What is your parental leave policy? | |
Would I be the only woman developer on the team? | |
What is your policy/approach/guidelines on contributing back to open source software projects? | |
What is the team like? Number, composition, specialties? Do they do pull requests or push to master, what are their favorite conferences, is there an on call rotation? :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// credit to Michael Lennon | |
import React, {Component, button} from "react"; | |
import PropTypes from "prop-types"; | |
import DatePicker from "material-ui/DatePicker"; | |
import moment from "moment-timezone"; | |
function DatePickerClearable({style, datePickerStyle={}, ...datePickerProps}) { | |
function clearBtnClickWrapper() { | |
datePickerProps.onChange(null, null); // (event, newValue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.flywaydb.core.Flyway; | |
import org.flywaydb.core.api.MigrationInfo; | |
import org.flywaydb.core.api.callback.BaseFlywayCallback; | |
import org.flywaydb.core.api.callback.FlywayCallback; | |
import org.flywaydb.core.api.configuration.FlywayConfiguration; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | |
import org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer; |