Skip to content

Instantly share code, notes, and snippets.

@uraway
uraway / index.jsx
Created March 20, 2019 04:47
React Cancelable Axios
import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
import axios from "axios";
function useAxios(fetchAction) {
useEffect(() => {
const signal = axios.CancelToken.source();
fetchAction({ signal });
return () => {
signal.cancel("Api is being canceled");
@uraway
uraway / github-issues.coffee
Last active April 13, 2016 14:28
create, list up, close github issues via hubot
# Description
# A Hubot script managing Github issues
# You need acquire a token first:
# $ curl -i https://api.github.com/authorizations -d '{"note":"githubot","scopes":["repo"]}' -u "yourusername"
# $ export HUBOT_GITHUB_TOEKN=token_value
#
# Commands:
# hubot issue list - list up issues
# hubot issue create <title> body <content> - create an issue with a body
# hubot issue close <number> - close an issue