Skip to content

Instantly share code, notes, and snippets.

View valscion's full-sized avatar

Vesa Laakso valscion

View GitHub Profile
@valscion
valscion / App.test.js.patch
Last active November 17, 2016 14:13
#create-react-app/1052 example
diff --git a/packages/react-scripts/template/src/App.test.js b/packages/react-scripts/template/src/App.test.js
index b84af98..8cefbcf 100644
--- a/packages/react-scripts/template/src/App.test.js
+++ b/packages/react-scripts/template/src/App.test.js
@@ -3,6 +3,12 @@ import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
+ const fn = ({ a, ...otherProps }) => otherProps;
+
@valscion
valscion / BodyScrollPreventer.js
Created January 8, 2017 15:39
Preventing scroll for modals
/* @flow */
import React, { Component } from 'react';
// $FlowFixMe
import $ from 'jquery';
// Disables body element scrolling on touch past the element passed in.
// This is the only way to stop the body element from scrolling on Mobile Safari
function preventOverscroll(el: HTMLElement) {
// If the element is not scrollable, the body may scroll instead.
@valscion
valscion / 1-sys-log.log
Created August 11, 2017 19:51
Allegro: App freeze on start, sometimes
default 22:37:22.199734 +0300 kernel [speed pid:1797 mux-aware] starting, non-mux-aware app count 0, switch-state 0 IG FBs 0 EG FBs 1:f power-state 0 3D busy HDA idle
default 22:37:22.199812 +0300 kernel [speed pid:1797 non-mux-aware] starting, non-mux-aware app count 1, switch-state 0 IG FBs 0 EG FBs 1:f power-state 0 3D busy HDA idle
default 22:37:22.287670 +0300 kernel NVDA(Graphics): Channel exception! Exception type = 0x45 Graphics Engine Error (GR Class Error)
default 22:37:22.287680 +0300 kernel NVDA(Graphics): Channel exception! Exception type = 0x45 Graphics Engine Error (GR Class Error)
default 22:37:22.287681 +0300 kernel NVDA: Channel Info: [19, 0x13, 0x12, 0x16e]
default 22:37:22.287682 +0300 kernel Channel Info: [19, 0x13, 0x12, 0x16e]
default 22:37:22.287684 +0300 kernel NVDA: Version Info: [com.apple.GeForce, 10.1.7, 0x7d780b0a, 18894120, 355.10.05.45f01, 1]
default 22:37:22.287685 +0300 kernel Version Info: [com.apple.GeForce, 10.1.7, 0x7d780b0a, 18894120, 355.10.05.45f01, 1]
default
@valscion
valscion / allegro.log
Created August 11, 2017 20:17
allegro freeze machine on start
stdio D file_stdio.c:109 file_stdio_fopen [ 0.00000] opening /Users/vesa/code/muut/allegro5/build/./demos/speed/speed.app/Contents/MacOS/allegro5.cfg r
MacOSX D system.m:134 osx_sys_init [ 0.00000] system driver initialised.
system I system.c:257 al_install_system [ 0.00000] Allegro version: 5.2.2
MacOSX D osxgl.m:1524 create_display_win [ 0.00029] Creating window sized 640x480
MacOSX I system.m:365 osx_get_num_video_adapters [ 0.00031] Detected 1 displays
MacOSX D osxgl.m:741 osx_set_opengl_pixelformat_attributes [ 0.00034] Using default colour depth 32
MacOSX D osxgl.m:788 osx_set_opengl_pixelformat_attributes [ 0.00035] Passing pixel format attribute ALLEGRO_SAMPLE_BUFFERS = 1
MacOSX D osxgl.m:788 osx_set_opengl_pixelformat_attributes [ 0.00035] Passing pixel format attribute ALLEGRO_SAMPLES = 4
MacOSX
@valscion
valscion / depfu-lfs
Last active November 28, 2017 12:15
Depfu + Git LFS. MIT licensed
#!/usr/bin/env bash
# MIT License
#
# Copyright (c) 2017 Vesa Laakso
#
# 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
@valscion
valscion / circleci-steps.yml
Created December 13, 2017 15:13
Depfu + Git LFS + CircleCI. MIT licensed
steps:
- checkout
- run: ssh git@github.com git-lfs-authenticate venuu/venuu.git download
- run:
name: Pull LFS files
command: |-
git lfs install
git lfs pull
- run:
name: Fix LFS files committed as regular binary files
@valscion
valscion / SketchSystems.spec
Created September 10, 2018 08:56
Ilmoita muu tilanne
Ilmoita muu tilanne
Start*
option1 -> Saving
option2 -> Saving
option3 -> Saving
option4 -> Muu tilanne
Saving
success -> Success
failure -> Failed
Failed
@valscion
valscion / machine.js
Last active September 24, 2019 11:52
Generated by XState Viz: https://xstate.js.org/viz
const handleRequestSuccess = assign({
results: (_ctx, event) => event.results
});
const handleHistoryPopState = assign({
results: (_ctx, event) => event.results
});
const searchStateMachine = Machine({
id: 'search',
@valscion
valscion / machine.js
Created September 24, 2019 12:28
Generated by XState Viz: https://xstate.js.org/viz
const handleRequestSuccess = assign({
results: (_ctx, event) => event.results
});
const handleHistoryPopState = assign({
results: (_ctx, event) => event.results
});
const searchStateMachine = Machine({
id: 'search',
@valscion
valscion / machine.js
Last active September 25, 2019 07:13
Generated by XState Viz: https://xstate.js.org/viz
const handleRequestSuccess = assign({
results: (_ctx, event) => event.results
});
const searchStateMachine = Machine({
id: 'search',
initial: 'idle',
context: {
results: []