Skip to content

Instantly share code, notes, and snippets.

View s2k's full-sized avatar
🤩

Stephan Kämper s2k

🤩
View GitHub Profile
class Wtf
def method_missing(name, *args)
:lol
end
def respond_to?(name)
:nope
end
def respond_to_missing?(name)

Talmudic Gems For Rails Developers

Sources, Citations, and Further Reading

diff --git a/babel.config.js b/babel.config.js
index b8b230b..f930f3e 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -30,7 +30,6 @@ module.exports = function(api) {
{
forceAllTransforms: true,
useBuiltIns: 'entry',
- corejs: 3,
modules: false,
@lambdamusic
lambdamusic / keynote.scpt
Last active April 23, 2024 18:33
Apple Keynote: export presenter notes
-- HOWTO:
-- after saving it, open with Script Editor (default) and run it
-- PREREQUISITES:
-- make sure your Keynote presentation is open in the background
-- AFTER EXPORT:
-- if you can't open the file due to encoding errors, open with Sublime (or another a text editor) and then "File / Save with encoding / UTF8"
tell application "Keynote"
@fxn
fxn / problem-solving-games.md
Last active June 11, 2023 17:21
Problem-Solving Games
@larrycai
larrycai / README.markdown
Last active September 16, 2022 03:59
check the plugin usage in jenkins
@JamesChevalier
JamesChevalier / mac_utf8_insanity.md
Last active March 23, 2024 16:13
Unicode on Mac is insane. Mac OS X uses NFD while everything else uses NFC. This fixes that.

convmv manpage

Install convmv if you don't have it

sudo apt-get install convmv

Convert all files in a directory from NFD to NFC:

convmv -r -f utf8 -t utf8 --nfc --notest .

@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@elgalu
elgalu / write_expectation.rb
Last active May 9, 2019 08:39
An RSpec expectation to test text written to standard output and standard error
require 'rspec'
require 'stringio'
# Custom matcher to test text written to standard output and standard error
#
# @example
# expect { $stderr.puts "Some random error" }.to write(/Some.* error/).to(:stderr)
#
# @example
# expect { $stderr.puts "Some specific error" }.to write('Some specific error').to(:stderr)