Skip to content

Instantly share code, notes, and snippets.

View klaytonfaria's full-sized avatar
🧪
Focusing

Klayton Faria klaytonfaria

🧪
Focusing
View GitHub Profile

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@klaytonfaria
klaytonfaria / index.js
Last active February 7, 2024 09:52
React-native MessageQueue.spy use
import React from 'react';
import {AppRegistry} from 'react-native';
import MainScreen from './screens/main';
import relayContainer from 'shared/relay-container';
import MessageQueue from 'react-native/Libraries/BatchedBridge/MessageQueue';
AppRegistry.registerComponent('MainScreen', () => relayContainer(MainScreen));
// Disable warning box on development mode
console.disableYellowBox = true;
@klaytonfaria
klaytonfaria / component-orchestrator.js
Created April 26, 2018 22:07
React component orchestrator schema
const orchestrator = {
// slug: String,
// title: String,
// description: String,
// step: Number,
// steps: Number,
items: [Object],
// progress: Number,
// progressType: String,
// startedAt: Date,
export default {
dest: './public',
base: '/',
hashRouter: true,
codeSandbox: false,
files: './docs/**/*.mdx',
themeConfig: {
logo: {
src: 'https://instagram.flis8-2.fna.fbcdn.net/vp/7d2e51b014efca981d3a8eb4bf5c3d07/5C916DBF/t51.2885-19/s320x320/14482113_1143788649039310_7192075474778980352_a.jpg',
width: 160,
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const sourcePath = process.argv[ 2 ] || './example/files.json';
const fileList = require(path.resolve(__dirname, '../', sourcePath));
const outputPath = process.argv[ 3 ] || './Static/';
const findProcessTag = tag => process.argv.some(val => val.indexOf(tag) >= 0);
@klaytonfaria
klaytonfaria / sentry.nginx.conf
Created January 23, 2019 15:56
Sentry NGINX config
server {
listen 80 default_server;
server_name sentry.xablau.com;
location / {
proxy_pass http://127.0.0.1:9000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
sudo iptables -I INPUT 2 -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 2 -p tcp --dport 80 -j ACCEPT
sudo iptables-save > /etc/iptables/rules.v4

Script to track % of TypeScript in your repo / project

If you are migrating to TypeScript it may be nice to keep track of how you are doing for a particular project, here is an example of using Tokei and jq to do this.

You can install both via Homebrew

  • brew install jq
  • brew install tokei