Skip to content

Instantly share code, notes, and snippets.

View jumski's full-sized avatar
🐴
For the lack of a nail, throw new HorseshoeNailNotFoundException("no nails!");

Wojtek Majewski jumski

🐴
For the lack of a nail, throw new HorseshoeNailNotFoundException("no nails!");
  • Independent hacker
View GitHub Profile
@v-kolesnikov
v-kolesnikov / Gemfile
Last active April 3, 2023 11:31
Asynchronous files downloader.
# frozen_string_literal: true
source "https://rubygems.org"
gem 'down'
gem 'dry-monads'
gem 'http'
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 3, 2024 06:43
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@r00k
r00k / a1.md
Last active August 29, 2015 14:17
Ruby Quiz Question 2

Answer to Question 1:

The method shown is inject, (aka reduce).

I love inject, and you should too!

Jay Fields loves inject so much he wrote a love letter to it.

(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
}else{
@phillbaker
phillbaker / README.md
Last active November 1, 2017 17:44
A micro Gem for rspec controller spec default parameters.
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/