Skip to content

Instantly share code, notes, and snippets.

Where we left

  • UI should be an afterthought
  • Write code that allows to sepearate business logic frow UI.
  • Write code that allows to inject any hard-to-test, too-verbose, want-this-mocked stuff logic.

Is redux a good tool for impelmenting these ideas?

  • It has special place for handling business logic, called middleware.
  • Popular middleware have a mechanism for context injection. If you are writing your own custom middleware, then you probably should think about adding this too.
@dra1n
dra1n / storybook.md
Last active September 3, 2021 08:40

What it gives?

  • Visual documentation

    • Discoverability (Easier to find existing components. Potentially works for designers too. As a result, we are saving time because we are not doing the same thing again and again)
    • Regression (Breaking design or API changes will be reflected)
    • Describes component API (And edge cases)
    • Hints to intended usage
  • Faster design delivery (than having component embedded into the page)

  • Early design feedback
@Kolenov
Kolenov / perlbrew_libgcc_s.txt
Created December 4, 2018 10:27 — forked from Dreyer/perlbrew_libgcc_s.txt
[perlbrew] ld: library not found for -lgcc_s.10.4
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib
@devxom
devxom / html.json
Last active December 24, 2022 01:01
https://gist.github.com/akella/9757676 snippets ported for vscode
{
"Block (with comment)": {
"prefix": "di",
"body": [
"<!-- begin ${1} -->",
"<div class=\"${1}\">",
"\t${2}",
"</div>",
"<!-- end ${1} -->"
]
@attilagyorffy
attilagyorffy / application_helper.rb
Created June 11, 2017 14:31
Responsive Images in Rails applications
module ApplicationHelper
def responsive_image_tag(image, options = {})
content_tag(:picture) do
concat content_tag(:source, nil, media: '(max-width: 768px)', srcset: image.url(:thumbnail_mobile))
concat content_tag(:source, nil, media: '(max-width: 960px)', srcset: image.url(:thumbnail_tablet))
concat image_tag(image.url(:thumbnail_desktop), options)
end
end
end
@ascendbruce
ascendbruce / README.md
Last active May 8, 2024 17:50
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

ℹ️ There is a newer alternative project that does similar things and more, check it out at https://github.com/stevenilsen123/mac-keyboard-behavior-in-windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

How does it work

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@fljot
fljot / Mac OS X 10_5_ Windows Ctrl.xml
Last active January 9, 2023 07:12
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">