Skip to content

Instantly share code, notes, and snippets.

View trotzig's full-sized avatar

Henric Trotzig trotzig

View GitHub Profile
const REGEX_CONST_LET_VAR = XRegExp(`
\A
(?<declaration_keyword>const|let|var)\s+ # <declaration_keyword>
(?<assignment>.+?) # <assignment> variable assignment
\s*=\s*
(?<import_function>\w+?)\( # <import_function> variable assignment
(?<quote>'|\") # <quote> opening quote
(?<path>[^\\2\n]+) # <path> module path
\k<quote> # closing quote
\);?
@trotzig
trotzig / const_let_var_patttern.rb
Created March 15, 2017 19:59
Example of regex used in import-js before moving to babylon
REGEX_CONST_LET_VAR = /
\A
(?<declaration_keyword>const|let|var)\s+ # <declaration_keyword>
(?<assignment>.+?) # <assignment> variable assignment
\s*=\s*
(?<import_function>\w+?)\( # <import_function> variable assignment
(?<quote>'|") # <quote> opening quote
(?<path>[^\2\n]+) # <path> module path
\k<quote> # closing quote
\);?
diff --git a/spec/waypoint_spec.js b/spec/waypoint_spec.js
index 2f7e316..d739cef 100644
--- a/spec/waypoint_spec.js
+++ b/spec/waypoint_spec.js
@@ -329,6 +329,46 @@ describe('<Waypoint>', function() {
});
});
+ describe('with children', () => {
+ beforeEach(() => {
commit b11cb468cc7ab88827fd5994244d066da748bb2a
Author: Jan Paul Posma <jp.posma@brigade.com>
Date: Sat Jun 27 16:51:05 2015 -0700
Add 3d effect to hot loading
I thought it'd be fun to create something to show that the page is
hot loading when making changes, to give us something to look at for
those few seconds that you can't really productively spend otherwise
anyway. This introduces a fun 3d effect to do just that.
@trotzig
trotzig / count_commits.sh
Last active November 18, 2016 07:59
Counting commits
#!/bin/bash
# Run the script like this:
# > bash count_commits.sh <name>
# where name is a uniquely identifying string for a contributor, e.g. "Lencioni"
repos=( "causes" "brigade" "devscripts" "cuisine" "scss-lint"
"brigade-cap-tasks" "overcommit" "mock_redis" "sass-enhance"
"eslint-config-brigade" "react-waypoint" "haml-lint" "async_observer" "bender"
"react-simple-pie-chart" "tech-interview" "url-sweatshirt" "db-query-matchers"
commit 7b5f5c739eefb8c5bca2981b007ab09b8df9b63a
Author: Henric Trotzig + Kevin Kehl <henric.trotzig+kevin.kehl@brigade.com>
Date: Mon Jul 11 21:46:09 2016 +0200
Load partner tools asynchronously
This is the first commit in a serious of commits aiming to split up our
application bundle into smaller pieces. By using the `lazy` support of
the bundle-loader webpack plugin [1], we can make require statements
resolve a function that can be used to asynchronously load a module
@trotzig
trotzig / gist:7048039
Created October 18, 2013 20:47
Script to check commit messages for alliterations.
.
@trotzig
trotzig / import_js_talk_proposal.txt
Last active December 14, 2015 18:02
A talk proposal for React conf 2016
Import-JS lightning talk proposal
Talk title: Where's that module again?
With JavaScript development becoming more and more modular, keeping track of
your dependencies can be a pain. To import a module you need to know where it is
located in the file system, and with a growing application this will quickly
become a problem. Typing all those "import foo from..." lines can hurt even the
most COLEMAK-savvy people out there. To ease some of that burden, you can
automate the process of importing dependencies through an editor plugin.
@trotzig
trotzig / diffux_ci_talk_proposal.txt
Last active December 13, 2015 12:41
A talk proposal for React conf 2016
Diffux CI lightning talk proposal
Talk title: Visual diffing for React components
Are you worried that your CSS changes will break the styling of a component?
Are you scared that your code refactoring will result in visual bugs? Do you
find it difficult to understand how a code change affects the appearance of your
components? If you answer yes to any of the questions above, you want a visual
diffing tool. While many exist, Diffux-CI is the best one for React.
$z-index-menu: 100;
$z-index-navigation-main: 200;
$z-index-floating-action-button: 300;
$z-index-modal-wrapper: 400;
$z-index-toast: 500;
$z-index-n-progress: 600;