Skip to content

Instantly share code, notes, and snippets.

View CoralineAda's full-sized avatar
💭
Making trouble as usual

Coraline Ada Ehmke CoralineAda

💭
Making trouble as usual
View GitHub Profile
(begin
(send nil :require
(str "spec_helper"))
(block
(send nil :describe
(const nil :Project))
(args)
(begin
(block
(send nil :describe

What are you looking for in a mentor? What are your short-term and long-term goals? How do you best work with people? What level of experience with Ruby do you feel you have? What is it that you really want to be and do? What are you doing really well to help you get there? What could you be doing better in terms of getting there? How can I best help you achieve your goals? Have you had a mentor before, and if so, what was the experience like? What makes you happiest?

@CoralineAda
CoralineAda / lhc_coc.md
Created September 26, 2016 15:52
LHC Slack Code of Conduct

Community Covenant

Our Goal

This community is dedicated to providing a harassment-free experience for everyone. We do not tolerate harassment of participants in any form.

Applicability and Scope

This code of conduct applies to all of this community's spaces, including public channels, private channels and direct messages, both online and off. Anyone who violates this code of conduct may be sanctioned or expelled from these spaces at the discretion of the administrators.

@CoralineAda
CoralineAda / chunker.rb
Last active May 29, 2017 20:11
Recursive solution to breaking up arbitrary text into tweet-sized chunks
class Chunker
def chunk_message(message, handle="", chunked=[])
return chunked unless message.present?
chunks = message.split
proposed_chunk = [handle, chunked.last, chunks[0]].compact.join(' ').squish
if proposed_chunk.length <= 140
chunked << [chunked.pop, chunks.shift].compact.join(' ')
else
chunked << chunks.shift
p (1..100).map{|i| (i % 15 == 0 && "fizzbuzz") || (i % 3 == 0 && "fizz") || (i % 5 == 0 && "buzz") || i} * ","
# config/initializers/attribute_types.rb
ActiveRecord::Type.register(:discount_line_type, DiscountLineType)
# discount_line_type.rb
class DiscountLineType < ActiveRecord::Type::Value
DISCOUNT_LINE = Struct.new(:name, :description, :amount, keyword_init: true)
def type
:jsonb
end

Keybase proof

I hereby claim:

  • I am coralineada on github.
  • I am coralineada13 (https://keybase.io/coralineada13) on keybase.
  • I have a public key ASD295ulEpugWN5kKtqVHr0O9-ZZkgqzgXeJrNZCSsM2mgo

To claim this, I am signing this object:

@CoralineAda
CoralineAda / ds_store.md
Created April 19, 2024 00:08
Recursively delete .DS_Store files
find . -name .DS_Store -print0 | xargs -0 rm
# Put your .mid file in a "midi" directory next to this file.
# Then, in your terminal in the directory that this file is in:
# gem install midilib
# ruby ./midisort.rb
# The _sorted MIDI file is now in the "midi" directory.
require 'midilib'
sequence = MIDI::Sequence.new()