Skip to content

Instantly share code, notes, and snippets.

View lifedraft's full-sized avatar

Stanislav lifedraft

View GitHub Profile
@lifedraft
lifedraft / SketchSystems.spec
Last active March 3, 2020 13:20
Add to cart V1*
Add to cart V1*
Click -> Cart Check
Add product to cart
Loading*
Success -> Success
Fail -> Response evaluate
Cart Check
Walk through -> Add product to cart
@lifedraft
lifedraft / SketchSystems.spec
Last active March 2, 2020 13:11
Add to cart V2*
Add to cart V2*
Click -> Add product to cart
Add product to cart
Loading*
Success -> Success
Fail -> Response evaluate
Response evaluate
Needs flight -> Open Flight modal
@lifedraft
lifedraft / machine.js
Last active January 17, 2020 15:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@lifedraft
lifedraft / machine.js
Created September 11, 2019 12:39
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../chart-js/chart-js.html">
@lifedraft
lifedraft / gist:3741b4045f5e78360c46
Created June 5, 2014 09:22
one page scroll implementation. made to work with offset content, eq. header or footer.
sections = jQuery('.dd_skrollr-numbers-section')
wrapper = jQuery('.dd_skrollr-numbers')
page_bottom = document.body.scrollHeight
# leave top
wrapper_position_top = wrapper.offset().top
wrapper_height = wrapper.height()
wrapper_position_bottom = wrapper_height + wrapper_position_top
@lifedraft
lifedraft / gist:9250476
Created February 27, 2014 13:55
Update meta viewport tag's content for fit page width. ios and android safe.
viewport = document.getElementById('viewport')
orientationchange = (event) ->
unit = "width"
current_orientation = window.orientation
wider = window.screen.width > window.screen.height
if (current_orientation == 180 and wider) or
(current_orientation == 0 and wider) or
(current_orientation == -90 and !wider) or
@lifedraft
lifedraft / gist:9115070
Created February 20, 2014 14:38
Execute some action on click/touchend after the second tap on an element.
if Modernizr.touch
_active = null
$context.bind 'touchend', (event) ->
_active = null
links = $context.find('.contents-item a').bind 'touchend', ->
if _active != this
_active = this
return false
@lifedraft
lifedraft / Gruntfile.js
Last active December 29, 2015 17:29
Compile all coffee and compass files recursively within an project with grunt.
module.exports = function( grunt ) {
// Compile all coffee and compass files recursively within an project with grunt.
// Usage:
// > cd <my-project>
// > npm install grunt-contrib-watch
@lifedraft
lifedraft / gist:7655319
Last active December 29, 2015 10:09
Debouncing Window Scroll events with requestAnimationFrame #jquery. Source: http://www.html5rocks.com/en/tutorials/speed/animations/
jQuery.request_scroll = (callback) ->
###
Callback for our scroll event - just
keeps a track on the last scroll value
###
onScroll = ->
lastScrollY = window.scrollY
requestTick()