Skip to content

Instantly share code, notes, and snippets.

View iHiD's full-sized avatar
💙

Jeremy Walker iHiD

💙
View GitHub Profile
@iHiD
iHiD / example.rb
Created March 31, 2020 11:58
Ruby Basics
class Lasagna
EXPECTED_MINUTES_IN_OVEN = 40
PREPERATION_MINUTES_PER_LAYER = 2
def remaining_minutes_in_oven(actual_minutes_in_oven)
expected_minutes_in_oven - actual_minutes_in_oven
end
def preperation_time_in_minutes(number_of_layers)
number_of_layers * PREPERATION_MINUTES_PER_LAYER
@iHiD
iHiD / median_wait_times.txt
Last active July 30, 2019 11:15
Exercism: Median wait times
These are the median wait times for exercises that were mentorees during the 4 weeks preceeding 6th July 2019.
ballerina: hello-world-service: 7 days
ballerina: greeting-service: 9 days
ballerina: service-invocation: None mentored
ballerina: legacy-service-client: None mentored
ballerina: calculator-service: None mentored
ballerina: order-management: None mentored
ballerina: service-composition: None mentored
@iHiD
iHiD / topics.txt
Created July 18, 2017 12:56
Mutual Exercism Topics
Control-flow (conditionals)
Control-flow (loops)
Equality
Exception handling
Inheritance
Pattern matching
Polymorphism
Recursion
Variables
https://open.spotify.com/user/ihid/playlist/21VGlswVvue1Twda6NTafN
@iHiD
iHiD / thoughts.js
Created September 7, 2016 21:42
Ways around "x || exception" in JS
// Problem: This doesn't work
// true || throw new Error('some_var not defined')
// > Uncaught SyntaxError: Unexpected token throw
// I would approach this by creating another function, either for
// after the ||, or to wrap the whole thing. It's not exactly ideal
// but it feels idiomatic in a functional language.
//--
// Suggestion 1: Define a wrapper function for throw
@iHiD
iHiD / config.rb
Last active June 10, 2017 15:05
Baruco 2014 Live Coding Talk on Propono.
require 'propono'
Propono.config do |config|
config.access_key = "AKIAIPE2MSOM5ZFGQBCQ"
config.secret_key = "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"
config.queue_region = "eu-west-1"
end
require 'twitter'
@twitter = Twitter::REST::Client.new do |config|
config.consumer_key = "OG9Zkag09onRe7b5ZLecO7HGb"
@iHiD
iHiD / instructions
Last active August 29, 2015 14:04 — forked from agraves/instructions
Instructions for clearing expired DigiCert SSL certificate on OSX by [https://gist.github.com/agraves](agraves)
NOTICE: The following instructions "worked for me." Proceed at your own risk.
Symptoms:
* Visiting several sites, such as github, gravatar, twitter's CDN results in "invalid certificate" errors
* For example: http://i.imgur.com/8gPRfI3.png
Instructions
@iHiD
iHiD / article.md
Last active August 29, 2015 14:03
Larva - A wrapper for Propono

Introduction

In my last article I introduced you to Propono - a pub/sub wrapper for Ruby. If you missed it, then I'd recommend going and having a read before you move on to this. To recap, Propono makes it exceptionally easy to publish and subscribe to messages between services using two simple methods:

# Service 1
Propono.listen_to_queue(:user) do |message|
  p "Message Received"
  p message
end
require 'net/http'
module Indicare
class NewsFeedItemProcessor < Larva::Processor
def news_feed_item_created
publish_to_flumen
end
private
def publish_to_flumen
nfi = MeducationSDK::NewsFeedItem.find(id)
@iHiD
iHiD / rules.md
Created March 25, 2014 12:39
Image Processing

For An Raster Image

  • Large File = Original File
  • Small File = 900x

For a single PPT

  • Large File = We output the first slide at 3000x
  • Small File = We output the first slide at 900x

For a single PPT

  • Large File = We output the first page at 3000x