Skip to content

Instantly share code, notes, and snippets.

View mhauken's full-sized avatar

Marius Hauken mhauken

View GitHub Profile
@mhauken
mhauken / idiotic.md
Last active August 29, 2015 13:57
Idiotic things that don't work in browsers
  • You cant change ::selection in input-fields..
  • You can't have before or after-elements on input, -submit, checkboxes, radiobuttons etc.
  • you can't target elements before or parent-elements
  • you can't target a ::before-element from the parent class
@mhauken
mhauken / compact-svg.sh
Last active August 29, 2015 14:10
For more compact SVG-export in @sketchapp run this in Terminal:
defaults write com.bohemiancoding.sketch3 exportCompactSVG -bool yes
@mhauken
mhauken / findings.md
Created January 11, 2016 12:31
Browser testing

IE 11 reads the content outside of the SVG-viewbox as well.

@mhauken
mhauken / __useful_javascript-snippets.md
Last active March 22, 2016 10:08
Useful javascript-snippets

Useful javascript-snippets:

  • fuzzy search
  • Get closest in a group
  • Reach clicked element inside functions
  • Scroll to top of element
  • Skip to content
  • Set timing in javascript
  • toggle specific class via general javascript and data-attributes
@mhauken
mhauken / plot.js
Last active February 28, 2017 15:05
Useful snippets from React in Flipdflops
/**
* This component should render a plot with Plotly, taking these three props:
*
* - xData: the data to be rendered on the x-axis as an array
* - yData: The data to be rendered on the y-axis as an array
* - type: The type of plot we want Plotly to render
*
* To see an example of how you should use Plotly look at the index.html file in the public/ folder.
* (and feel free to delete the code in there)
*/
@mhauken
mhauken / .bash_profile
Created September 27, 2017 13:58
test
# When you open a new Terminal session, this file is loaded by Bash.
# It loads in the other dotfiles path,bash_prompt,exports,aliases,functions,extra
# and configures some useful settings such as auto correcting typos when using cd completion.
# In some instances .bashrc can be loaded, so this file makes sure that .bash_profile is called.
# Add `~/bin` to the `$PATH`
export PATH="$HOME/bin:$PATH"
# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
@mhauken
mhauken / __Useful.html
Last active April 6, 2018 09:24
Useful HTML snippets
<!--
&shy; = Soft hyphen. To break text where you want
-->
Onelongword&shy;thatwewant&shy;tobreak
@mhauken
mhauken / svgo.json
Last active April 16, 2018 08:13 — forked from bendc/svgo.json
Sketch's SVGO Compressor settings
{
"comment": "A modified svgo compression-settings for SVGO-compresspor by Marius Hauken. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": false,
"indent": 0,
"plugins": [
{
"name": "cleanupAttrs"
},
{
"name": "cleanupEnableBackground"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhauken
mhauken / modulo.jsx
Last active November 21, 2019 15:14
Modulus example
import React from "react"
import styled from "styled-components"
const anArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
const colorArray = ["#D8CFAC", "#F8F2D3", "#FFAB00", "#62796C", "#DAE0DC"]
const ModulusExample = () => (
<Wrapper>
{anArray.map((item, index) => (