Skip to content

Instantly share code, notes, and snippets.

View sergiokopplin's full-sized avatar
🌍
Working from home

Sérgio A. Kopplin sergiokopplin

🌍
Working from home
View GitHub Profile
@vietlubu
vietlubu / annepro2.json
Last active June 10, 2023 16:57
Anne pro 2 Karabiner mapping to transform right_shift to up_arrow. Download and copy to `~/.config/karabiner/assets/complex_modifications/`
{
"title": "Anne pro 2",
"rules": [
{
"description": "left_command + right_shift = left_command + up",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_shift",
@drmikecrowe
drmikecrowe / machine.js
Created November 21, 2019 18:47
Generated by XState Viz: https://xstate.js.org/viz
const RETRY_INTERVAL = 2000;
const MAX_RETRIES = 3;
const initHardwareState = "initHardware";
const connectNetworkState = "connectNetwork";
const provisionState = "provision";
const retryState = "retry";
const fatalState = "fatal";
const connectedState = "connected";
@boreycutts
boreycutts / i3-gaps_installation_guide.md
Last active January 30, 2024 19:05
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
@schmich
schmich / ducky.md
Last active April 5, 2024 14:20
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

'padding-line-between-statements': [2,
// Always require blank lines after directive (like 'use-strict'), except between directives
{blankLine: 'always', prev: 'directive', next: '*'},
{blankLine: 'any', prev: 'directive', next: 'directive'},
// Always require blank lines after import, except between imports
{blankLine: 'always', prev: 'import', next: '*'},
{blankLine: 'any', prev: 'import', next: 'import'},
// Always require blank lines before and after every sequence of variable declarations and export
{blankLine: 'always', prev: '*', next: ['const', 'let', 'var', 'export']},
{blankLine: 'always', prev: ['const', 'let', 'var', 'export'], next: '*'},
@ecavalcanti
ecavalcanti / App.js
Created June 22, 2017 12:31
React Native - ActivityIndicator Overlay
import React, { Component } from 'react'
import { AppRegistry, View, Text, TextInput, StyleSheet, TouchableOpacity, ActivityIndicator } from 'react-native'
export default class App extends Component {
state = {
loading: false
}
renderLoading() {
if (this.state.loading) {
Red Science:
0eNqdmttu6zYQRf9Fz1YhXhX7Vw4OCkVhE6K6QZLbBkH+vcqxnTQNHc/ik2Gb3kOtGc6F8Etx3x3DNMdhLQ4vRWzHYSkOP16KJT4OTff22fo8heJQxDX0xa4Ymv7t3dLGMLShnJr2z1IVr7siDg/hn+KgXn/uijCscY3hpPTrzfPvw7G/D/O24F2jWZbQ33dxeCz7pn2KQyj1ZmEal+3H4/BmexMs613xvL3ozcYc2jglzX8xo9/N/NEsa7nOzbBM47yW96FbE1bsyYrZrDzEzc7pO5tQNlDZJJV9Qtl+Vj5uROfHedxer2nrtPbu4rTxuE7HNcXHQTdUWV7wn58oDkuY1+2LL/LpB9EJyZpCMjcYxeEKorvPlpapi2ty8+fY0b+52z7es+hx4uBR1btyHx7isS9Dt62fY1tOYxe+SvuLdEpMsW3W4tOjPg5mN24h99RsDnz4JjLKMwIlQGCk4XYR1bfjTVnI9XLgdRKsy8seSkDW56U8iXSdJ60F0ndin+nkfpM++zhlS990Xdk1/XQ16SQdpelxet9dSgweJyN+Uq2zlAWO0bDOyaNJ26wcmHaTk4aPk+/P0xLjk1QFJUbXWXlW386FWnyu6u8Cdy9V8d+omCqv51Os2TAKpv/q9vkymeVKUK2MESWpcy5Ng7VZ1USQV0xenaoE7XNemZIo0yqlUzSSyrRISSJrn9WBwzNhK+nOLw5MidCZ7aQFZwVLj5oYtTVw//4r6jiPQ/kYmrn8+ymELvkANqdiCgLb0sN4ykGCbtz6LGVB+2DzWkZBZbN3WcrJOcfupTPeOcGJZjxXZSUiwZDnYCNZKrGyztqzIBKcgZ10dd1fzsIckXx+/XZHtcbufEH1/ye7+xhmz7bacWjnsIZfp/7Kcs2WK7S8QquZNtu4lErNINYMYs0g1ghijSDWCGKNIHoG0TOInkH0CKJHED2C6BFExyA6BtExiA5BdAiiQxAdgmgZRMsgWgbRIogWQbQIokUQDYNoGETDI
const ComponentWithSavePost = graphql(savePostMutation, {
props: ({ mutate }) => ({
savePost: (title, body) => mutate({ variables: { title, body } }),
}),
})(Component);
@evansiroky
evansiroky / icon.js
Created September 27, 2016 00:57
Mocking children components with Jest - does this make sense?
import React from 'react'
export default class Icon extends React.Component {
render () {
const {type, className} = this.props
return (
<i
className={`fa fa-${type} fa-fw ${className}`}
{...this.props}
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {