Skip to content

Instantly share code, notes, and snippets.

@nelsonomuto
nelsonomuto / material-design-shadows.css
Created June 14, 2021 20:04 — forked from serg0x/material-design-shadows.css
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
/* Shadow 0dp */
box-shadow: none;
/* Shadow 1dp */
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
/* Shadow 2dp */
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20);
/* Shadow 3dp */
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Baz from 'baz'
class Foo extends Component {
static propTypes = {
list: PropTypes.array,
}
static defaultProps = {
@nelsonomuto
nelsonomuto / ScrollManager.jsx
Created December 4, 2018 20:22 — forked from jeffijoe/ScrollManager.jsx
Save and restore scroll position in React
/*
The MIT License
Copyright (c) Jeff Hansen 2018 to present.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION W
@nelsonomuto
nelsonomuto / rename.sh
Last active September 7, 2018 20:05 — forked from mustafaturan/rename.sh
Rename all js files into jsx
for x in *.jsx; do mv "$x" "${x%.jsx}.js"; done
(function flatten(arr, currentIndex = 0, flattened = []) {
let currItem;
if (currentIndex >= arr.length) {
return flattened;
}
currItem = arr[currentIndex++];
if (!Array.isArray(currItem)) {
flattened.push(currItem);
@nelsonomuto
nelsonomuto / wip-commit.sh
Created January 22, 2018 16:02
wip-commit.sh
git add . && git commit -m '$1' && git push
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'p',
classNames: ['x-input'],
attributeBindings: ['dataFieldName:label']
});
@nelsonomuto
nelsonomuto / README.md
Created November 17, 2017 20:11 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@nelsonomuto
nelsonomuto / .vimrc js
Last active November 7, 2017 21:49
html5 vimrc (js, less, scss, sass)
syntax on
" for command mode
" nnoremap <S-Tab> <<
" for insert mode
inoremap <S-Tab> <C-d>
set pastetoggle=<F3>
set expandtab ts=4 sw=4 ai
autocmd Filetype html setlocal ts=2 sw=2 expandtab
@nelsonomuto
nelsonomuto / Angular Material Design Starter App.markdown
Created April 9, 2016 00:08
Angular Material Design Starter App