Skip to content

Instantly share code, notes, and snippets.

View mskasal's full-sized avatar

Mustafa Samed Kasal mskasal

View GitHub Profile
@mskasal
mskasal / raised.css
Created November 24, 2014 16:25
Material design layers, raised/raised-low/raised-high CSS
.raised {
box-shadow: 0 3px 10px rgba(0,0,0,.23),0 3px 10px rgba(0,0,0,.16);
-webkit-transition: box-shadow .28s cubic-bezier(0.4,0,.2,1);
transition: box-shadow .28s cubic-bezier(0.4,0,.2,1);
}
.raised-low{
box-shadow: 0 3px 10px rgba(0,0,0,.23),0 2px 10px rgba(0,0,0,.16);
-webkit-transition: box-shadow .28s cubic-bezier(0.4,0,.2,1);
transition: box-shadow .28s cubic-bezier(0.4,0,.2,1);
@mskasal
mskasal / timezones
Created June 30, 2015 07:19
List of all timezones with GMT and raw diff.
{"Belarus": [
{
"id": "Europe/Minsk",
"diff": "GMT+03:00",
"rawDiff": 10800000,
"name": "Minsk"
}
], "Philippines": [
{
"id": "Asia/Manila",
@mskasal
mskasal / timezonegps.json
Last active October 25, 2015 00:47
List of all timezones with coordinates
{
"countries": {
"AD": {
"name": "Andorra",
"abbr": "AD",
"zones": [
"Europe/Andorra"
]
},
"AE": {
@mskasal
mskasal / MarsRover.js
Created August 8, 2017 20:23
Mars Rover challenge
/* MARS ROVERS
A squad of robotic rovers are to be landed by NASA on a plateau on Mars. This plateau, which
is curiously rectangular, must be navigated by the rovers so that their on-board cameras can
get a complete view of the surrounding terrain to send back to Earth.
A rover's position and location is represented by a combination of x and y co-ordinates and
a letter representing one of the four cardinal compass points. The plateau is divided up into
a grid to simplify navigation. An example position might be 0, 0, N, which means the rover is
in the bottom left corner and facing North.
@mskasal
mskasal / asynLocalCollection.js
Created February 10, 2018 12:14
Create and manage localStorage collection asynchronously.
const asyncLocalStorage = {
createCollection: (collectionName, data) => Promise.resolve().then(() => {
if (!(data instanceof Object)) {
throw Error('Local storage collection can be only valid JSON.');
}
return localStorage.setItem(collectionName, JSON.stringify(data));
}),
getCollection: collectionName => Promise.resolve().then(() =>
localStorage.getItem(collectionName)),
setItem: (key, value, collectionName) => Promise.resolve()
@mskasal
mskasal / fireEvent.js
Created May 26, 2018 20:26
fireEvent with javascript
/**
* Fire an event handler to the specified node. Event handlers can detect that the event was fired programatically
* by testing for a 'synthetic=true' property on the event object
* @param {HTMLNode} node The node to fire the event handler on.
* @param {String} eventName The name of the event without the "on" (e.g., "focus")
*/
function fireEvent(node, eventName) {
// Make sure we use the ownerDocument from the provided node to avoid cross-window problems
var doc;
if (node.ownerDocument) {
@mskasal
mskasal / cloudSettings
Last active November 12, 2019 12:41
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-12T12:41:08.201Z","extensionVersion":"v3.4.3"}
@mskasal
mskasal / Field.js
Created June 18, 2018 08:04 — forked from mxstbr/Field.js
Style Storybook with Styled Components
import React, { PropTypes } from 'react';
import styled from 'styled-components'
const Wrapper = styled.div`
// styles here that used to be for .test
`
const Label = styled.label`
// label styles here
`
// File: .storybook/config.js
import { configure, addDecorator } from '@kadira/storybook';
import Theme from './../src/ui/theme';
import React from 'react';
import { ThemeProvider } from 'styled-components'
function loadStories() {
require('../stories');
}
/**
* nearby.js
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2018, Codrops
* http://www.codrops.com
*/