Skip to content

Instantly share code, notes, and snippets.

View torifat's full-sized avatar
🇸🇩
Why do we even have this here?

Rifat Nabi torifat

🇸🇩
Why do we even have this here?
View GitHub Profile
@torifat
torifat / machine.js
Created May 13, 2020 02:48
Generated by XState Viz: https://xstate.js.org/viz
const extensionMachine = Machine({
id: 'extension',
initial: 'loading',
context: {
retries: 0
},
states: {
loading: {
on: {
LOAD_MANIFEST: 'manifestOnly',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
document.addEventListener('paste', e => {
@torifat
torifat / pr.md
Created December 18, 2016 21:26 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@torifat
torifat / __helpers.js
Created December 5, 2016 21:09
Jest toMatchObject
// @flow
const {
EXPECTED_COLOR,
RECEIVED_COLOR,
matcherHint,
printReceived,
printExpected,
printWithType
} = require('jest-matcher-utils');
@torifat
torifat / xterm-256color.svg
Created September 22, 2016 09:54 — forked from jasonm23/xterm-256color.svg
Xterm 256color mode color chart, organised into sections.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@torifat
torifat / .flowconfig
Created August 4, 2016 01:43
Default .flowconfig for create-react-app
[libs]
./node_modules/fbjs/flow/lib
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
@torifat
torifat / 000logdna.config
Created June 16, 2016 07:24 — forked from avnersorek/000logdna.config
AWS Elastic Beanstalk configuration script for forwarding logs to LogDNA
# Place this file in the .ebextensions folder of your project
files:
"/home/ec2-user/logdna.sh" :
mode: "000777"
owner: root
group: root
content: |
#!/bin/sh
echo "[logdna]
name=LogDNA packages
@torifat
torifat / class-property-semicolon.js
Last active January 29, 2016 15:58
$ jscodeshift -t ../codemod/static-property-semicolon.js src/
export default function(file, api) {
const j = api.jscodeshift;
const { expression, statement, statements } = j.template;
return j(file.source)
.find(j.ClassProperty)
.replaceWith(p => {
p.node.end++;
return p.node;
})

Keybase proof

I hereby claim:

  • I am torifat on github.
  • I am rifat (https://keybase.io/rifat) on keybase.
  • I have a public key whose fingerprint is 8358 0103 6662 7E4A 5110 3E3A 797E 605D 41E5 033A

To claim this, I am signing this object:

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).