Skip to content

Instantly share code, notes, and snippets.

View matthijsgroen's full-sized avatar
🚀
Computering

Matthijs Groen matthijsgroen

🚀
Computering
View GitHub Profile
import { fixupConfigRules } from "@eslint/compat";
import pluginJs from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
export default [
{ languageOptions: { globals: globals.browser } },
@matthijsgroen
matthijsgroen / functions.ts
Created April 18, 2022 14:20
Function composition with TypeScript
console.log("hello world");
const data = {
projects: [
{ technology: "Java", name: "Project1", budget: 1000, finishedInDays: 10 },
{ technology: "Java", name: "Project1", budget: 2000, finishedInDays: 15 },
{ technology: "Ruby", name: "Test", budget: 800, finishedInDays: 3 },
{ technology: "Ruby", name: "Backend", budget: 1200, finishedInDays: 10 },
{ technology: "Python", name: "Backend", budget: 1200, finishedInDays: 9 },
{
@matthijsgroen
matthijsgroen / myStyle.scss
Created January 31, 2018 07:53
Todo app from React Meetup
.done {
color: red;
}

Keybase proof

I hereby claim:

  • I am matthijsgroen on github.
  • I am matthijsgroen (https://keybase.io/matthijsgroen) on keybase.
  • I have a public key ASCVEsslcjw9zWUd7UFH_Aeed4GoVNbm6Mhe13GtymB8ywo

To claim this, I am signing this object:

if Rails.env.development?
require 'rubocop/rake_task'
# http://img4.wikia.nocookie.net/__cb20131111193341/lego/images/8/8b/Good_bad_cop.png
namespace :cop do
desc 'Run RuboCop using the CI config'
RuboCop::RakeTask.new(:good) do |task|
task.formatters = ['progress']
task.options = [['--config', 'tools/ci/rubocop.yml']]
task.fail_on_error = true
@matthijsgroen
matthijsgroen / ruby.rb
Created March 11, 2014 20:05
Syntax definitions
NAME = 'Programmer'
def say_hello(to)
raise StandardError.new('Noone to say hello to!') unless to
is_noon = Date.noon?
# We are missing some cases like
# good night, but this is enough value
# for now
@matthijsgroen
matthijsgroen / stub
Last active December 17, 2015 20:48
Command line stubs
#!/usr/bin/env ruby
# a clever way to stub the calls to bundle:
# put this file in fixtures and give the proper permissions:
# chmod +x spec/fixtures/bundle
# see spec/publish_spec.rb for usage:
# add path to the bundle stub to the beginning of the PATH env. var.
# Now when bundle is called, this stub file is used.
command = File.basename(__FILE__)
@matthijsgroen
matthijsgroen / context_helper.rb
Created May 16, 2013 06:15
Useful files for DCI in ruby
# Use as alternative for spec_helper for testing roles, and contexts
rails_root = File.expand_path('../../', __FILE__)
$LOAD_PATH.unshift(rails_root) unless $LOAD_PATH.include?(rails_root)
require 'database_cleaner'
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
@matthijsgroen
matthijsgroen / README.md
Last active December 12, 2015 10:39
Unit testing views in Ember

We (at Kabisa ICT) are in the process of learning Ember.js. We do all our development TDD, and want Ember.js to be no exception. We have experience building Backbone.js apps test-driven, so we are familiar with testing front-end code using Jasmine or Mocha/Chai.

When figuring out how to test views, we ran into a problem when the template for the view uses has a #linkTo statement. Unfortunately we are unable to find good test examples and practices. This gist is our quest to get answers how to decently unit-test ember applications.

When looking at the test for linkTo, we noticed it contains a full wiring of an ember app to support #linkTo. Does this mean we cannot stub this behaviour when testing a template?

How do you create tests for ember views using template renders?