Skip to content

Instantly share code, notes, and snippets.

View mikaelhadler's full-sized avatar
🌻
Make your reality

Mikael Hadler mikaelhadler

🌻
Make your reality
View GitHub Profile
@mikaelhadler
mikaelhadler / .zshrc
Created May 30, 2019 01:49
oh-my-zsh + nvim + fzf + POWERLEVEL9K + prettier
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/mikael/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

Issue Reference

$ npm -v
: not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm:
/mnt/c/Program Files/nodejs/npm: 6: /mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected (expecting "in")
i have node installed for windows (off the nodejs site).
<script>
import BlogSection from "~/components/Sections/BlogSection"
import { getAllPosts } from './plugins/getPosts'
console.log('component: ', getAllPosts)
}
</script>
@mikaelhadler
mikaelhadler / google-sheet-to-json.js
Created September 19, 2019 12:41 — forked from jonobr1/google-sheet-to-json.js
A node.js script to convert a Google Sheet into a JSON object
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
var https = require('https');
var path = require('path');
import React from 'react';
import 'antd/dist/antd.css';
import './App.css';
import { Layout, Menu, Breadcrumb } from 'antd'
const { Header, Content, Footer } = Layout
function App() {
return (
<div className="App">
<Layout className="layout">

Basic Methods

Prefix Method
imp→ import moduleName from 'module'
imn→ import 'module'
imd→ import { destructuredModule } from 'module'
ime→ import * as alias from 'module'
ima→ import { originalName as aliasName} from 'module'
exp→ export default moduleName
@mikaelhadler
mikaelhadler / mockAxios.js
Created November 20, 2019 16:14
Testing requests with jest and axios using a custom instance
const mockAxios = jest.genMockFromModule('axios')
mockAxios.get = jest.fn(() => Promise.resolve({ data: {} }))
mockAxios.post = jest.fn(() => Promise.resolve({ data: {} }))
mockAxios.put = jest.fn(() => Promise.resolve({ data: {} }))
mockAxios.patch = jest.fn(() => Promise.resolve({ data: {} }))
mockAxios.create = jest.fn(() => mockAxios)
export default mockAxios
@mikaelhadler
mikaelhadler / raindrop.py
Created January 20, 2020 18:40
Exercism challenge
def convert(number):
pass
@mikaelhadler
mikaelhadler / App.js
Created January 31, 2020 14:06
Configure instance express only in development or production - Express + Testing Routes + address already in use :::3000
import { env, port } from './config/vars'
import app from './config/express'
const development = env === 'development'
if (process.env.NODE_ENV !== 'test')
app.listen(
port,
() => development && console.log(`Server started on port ${port} (${env})`),
@mikaelhadler
mikaelhadler / init.vim
Last active March 6, 2020 19:14
NVim config for web development
call plug#begin("~/.vim/plugged")
" Theme
Plug 'mhartington/oceanic-next'
" Language Client
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier']
" File Explorer with Icons
Plug 'scrooloose/nerdtree'
Plug 'ryanoasis/vim-devicons'