Skip to content

Instantly share code, notes, and snippets.

@msokk
msokk / react-request.d.ts
Created June 7, 2018 13:24
react-request definitions
declare module 'react-request' {
interface FetchOptions extends RequestInit {
url: string;
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
}
type ResponseType =
| 'json'
| 'text'
| 'blob'
@msokk
msokk / api.tsx
Last active June 7, 2018 13:13
react-request with TS
import React from 'react';
import { Fetch, FetchSFCProps } from 'react-request';
interface User {
id: number;
name: string;
username: string;
email: string;
address: {
@msokk
msokk / fetch.tsx
Created June 6, 2018 16:22
Fetch idea
import React from 'react';
import axios, { AxiosRequestConfig } from 'axios';
/**
* Config
*/
export type FetchConfig = AxiosRequestConfig;
/**
* Public
@msokk
msokk / .eslintrc.js
Created August 13, 2017 14:51
<style> block linted by Eslint
module.exports = {
parser: "vue-eslint-parser",
extends: ["airbnb-base", "plugin:vue/recommended"]
};
@msokk
msokk / README.md
Last active May 6, 2016 14:27
Universal Assets
  1. Load the webpack plugin in your webpack config
import { UniversalAssetsPlugin } from '../lib/universal-assets/plugin';
...
{
  plugins: [
    new UniversalAssetsPlugin()
  ]
}

Keybase proof

I hereby claim:

  • I am msokk on github.
  • I am mihkel (https://keybase.io/mihkel) on keybase.
  • I have a public key whose fingerprint is 02AD C862 35B5 DC97 AD96 84B5 EED1 2E02 5E08 5B6C

To claim this, I am signing this object:

@msokk
msokk / README.md
Last active August 29, 2015 14:04 — forked from smileart/README.md
Agnoster Forked

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@msokk
msokk / distance-area.js
Created June 29, 2014 18:45
Distance Area Calculator for Illustrator CS6
if(app.activeDocument.selection[0]) {
var sel = app.activeDocument.selection[0];
var POINTMM = 0.3527777;
alert("Pindala: " + (Math.round(sel.area * (POINTMM*POINTMM) * 10) / 10000) + " dm2");
alert("Pikkus: " + (Math.round(sel.length * POINTMM * 100) / 100) + " mm");
}
@msokk
msokk / colorextract.js
Last active August 29, 2015 14:01
Colortunes modified
// Generated by CoffeeScript 1.6.3
(function() {
window.ColorExtract = (function() {
function ColorExtract() {}
ColorExtract.getColorMap = function(canvas, sx, sy, w, h, nc) {
var index, indexBase, pdata, pixels, x, y, _i, _j, _ref, _ref1;
if (nc == null) {
nc = 8;
}
@msokk
msokk / packages.json
Created May 16, 2014 20:15
Sublime 3 Conf
{
"installed_packages":
[
"Alignment",
"Better CoffeeScript",
"BracketHighlighter",
"CSScomb JS",
"DashDoc",
"DocBlockr",
"Git",