Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font
To setup native Linux, see this gist
#!/usr/bin/env bash | |
# 1. Run this script file | |
# bash <(curl -Ls https://bit.ly/3swaoUr) | |
# Homebrew & Apps | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
brew update |
Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font
To setup native Linux, see this gist
- webpack.config.js | |
- postcss.config.js | |
- config.js | |
- addons.js |
function _normalizeString(value) { | |
return value | |
.toString() | |
.replace(/á|ã|â/g, 'a') | |
.replace(/é|ê/g, 'e') | |
.replace(/í/g, 'i') | |
.replace(/ó|ô|õ/g, 'o') | |
.replace(/ú/g, 'u') | |
.replace(/ç/g, 'c') | |
.replace(/_/g, ''); |
xcode-select --install | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
brew cask install iterm2 | |
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts | |
brew install bash # latest version of bash | |
# set brew bash as default shell | |
brew install fortune | |
brew install cowsay | |
brew install git |
function fixImageMaps(force) { | |
var imgs = document.querySelectorAll("img[usemap]"); | |
[].forEach.call(imgs, function(img) { | |
if (!img.naturalHeight) { return; } | |
var h = img.height / img.naturalHeight; | |
var w = img.width / img.naturalWidth; | |
var map = document.getElementsByName(img.useMap.slice(1))[0]; | |
if (!map) { return; } | |
for (var i = 0; i < map.children.length; i++) { | |
var area = map.children[i]; |
const fs = require('fs'); | |
// Monkey-patch react-dev-utils to get the error overlay with SSR | |
const pathToDevClient = 'node_modules/react-dev-utils/webpackHotDevClient.js'; | |
// The react-scripts default | |
const reactScriptsPort = 3000; | |
// Read the dev client out of node_modules | |
const HotDevClient = fs.readFileSync(pathToDevClient, 'utf8'); |
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
import axios from 'axios'; | |
class Service { | |
constructor() { | |
let service = axios.create({ | |
headers: {csrf: 'token'} | |
}); | |
service.interceptors.response.use(this.handleSuccess, this.handleError); | |
this.service = service; | |
} |