Skip to content

Instantly share code, notes, and snippets.

Avatar
🤒
Why do we even have this here?

Rifat Nabi torifat

🤒
Why do we even have this here?
View GitHub Profile
View machine.js
const extensionMachine = Machine({
id: 'extension',
initial: 'loading',
context: {
retries: 0
},
states: {
loading: {
on: {
LOAD_MANIFEST: 'manifestOnly',
View index.html
<!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 Dec 18, 2016 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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 Dec 5, 2016
Jest toMatchObject
View __helpers.js
// @flow
const {
EXPECTED_COLOR,
RECEIVED_COLOR,
matcherHint,
printReceived,
printExpected,
printWithType
} = require('jest-matcher-utils');
@torifat
torifat / xterm-256color.svg
Created Sep 22, 2016 — forked from jasonm23/xterm-256color.svg
Xterm 256color mode color chart, organised into sections.
View xterm-256color.svg
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 Aug 4, 2016
Default .flowconfig for create-react-app
View .flowconfig
[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 Jun 16, 2016 — forked from avnersorek/000logdna.config
AWS Elastic Beanstalk configuration script for forwarding logs to LogDNA
View 000logdna.config
# 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 Jan 29, 2016
$ jscodeshift -t ../codemod/static-property-semicolon.js src/
View class-property-semicolon.js
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;
})
View keybase.md

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:

View gist:8ff784c7ff52ff6c4822

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).