Skip to content

Instantly share code, notes, and snippets.

View roNn23's full-sized avatar

Ronny Neefe roNn23

View GitHub Profile
@roNn23
roNn23 / machine.js
Created June 8, 2020 18:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@roNn23
roNn23 / small-component.js
Last active May 2, 2020 13:33
components #react
// eslint-disable-next-line react/prop-types
const AvailableAddress = ({ address }) => {
return (
<AddressStatus address={address} status="isAvailable" />
)
};
@roNn23
roNn23 / import-container.js
Created April 18, 2020 14:38
#js #react #bootstrap
import Container from 'react-bootstrap/Container'
import Row from 'react-bootstrap/Row'
import Col from 'react-bootstrap/Col'
@roNn23
roNn23 / media-query.scss
Last active April 18, 2020 12:29
#css #scss Bootstrap Krams
@include media-breakpoint-up(md) {
}
@roNn23
roNn23 / coloors-co-shades-in-console.js
Created August 4, 2019 19:51
Prints all colors from a coloors.co scheme in the console to copy the values more easily
let allColorData = [];
document.querySelectorAll('#colors .color').forEach(colorNode => {
const colorData = {
name: colorNode.querySelector('.color-info-name').textContent,
hex: colorNode.querySelector('.hex input').value,
shades: []
}
allColorData.push(colorData);
})
/**
* Window resize event handling
*/
angular.element($window).on('resize', function () {
console.log($window.innerWidth);
});
on alfred_script(q)
tell application "Sequel Pro" to quit
tell application "Dash" to quit
tell application "Tower" to quit
tell application "iTerm" to quit
tell application "Sublime Text 2" to quit
end alfred_script
@roNn23
roNn23 / laravel.js
Last active July 16, 2019 11:41 — forked from JeffreyWay/laravel.js
Updated delete-script of Jeffrey Way to work with Laravel 5. And optimized the implementation for the CSRF token. #laravel
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
Add this to your view:
<script>
window.csrfToken = '<?php echo csrf_token(); ?>';
@roNn23
roNn23 / react-jest-testing.js
Created July 16, 2019 11:39
React/Jest Testing #react #js #testing
// simple component test
import React from 'react';
import { shallow } from 'enzyme';
import Button from './Button';
function setupComponent (props) {
return shallow(<Button {...props} />);
}
it('should render the button', () => {
// full version
(function () {
var node = document.createElement('textarea')
var selection = document.getSelection()
let issue = '';
if(document.querySelector('#issuekey-val')) {
issue = document.querySelector('#issuekey-val').textContent;
}