Imagine we have a reducer to control a list of items:
function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
switch(action.type) {
case 'SHOW_ALL_ITEMS':
return action.data.items
default:
# A prettier Atom via PR #10208. | |
# https://github.com/atom/atom/pull/10208 | |
# Quit then remove. | |
osascript -e 'quit app "Atom"' | |
rm -rf /Applications/Atom.app | |
# Install, build, then open. | |
git clone -b pb-hidden-inset-1.8 git@github.com:briangonzalez/atom.git | |
cd atom |
#!/bin/bash - | |
#=============================================================================== | |
# FILE: repos.sh | |
# | |
# USAGE: Update all the git repos in your ~/code directory. This will | |
# skip over "dirty" (code changed and uncommited) repos and | |
# give a warning and, after completion, list those repos. | |
# | |
# The script will ask if you want to npm install or npm build | |
# in the frontend repos, default is "n" (no). |
const needsPolyfill = !window.Intl | |
/* eslint-disable import/no-webpack-loader-syntax */ | |
const intl = require('bundle-loader?lazy&name=intl!intl') | |
/* eslint-enable import/no-webpack-loader-syntax */ | |
const polyfilled = needsPolyfill && new Promise(resolve => { | |
intl(resolve) | |
}) |
const readline = require('readline'); | |
const fs = require('fs'); | |
const file = fs.createReadStream('yarn.lock'); | |
const rl = readline.createInterface(file); | |
let lastPkg, lastVer, lastLine, currPkg, currVer, currLine; | |
const re = /^"?(@?[^@]+)/; | |
rl.on('line', (line) => { |
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="robots" content="noodp, noydir" /> | |
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> | |
<link rel="canonical" href="http://mysite.com/" /> | |
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" /> |
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ |
After using terminals (iTerm, Terminal, Kitty) with an M1 Mac without issue for over a year, I finally came upon an issue that I couldn’t solve without using Rosetta. Rosetta is Mac software to run Intel Mac terminal commands on an M1 Mac. My issue initially came from trying to use Pyenv to install and use different versions of Python across multiple projects. After installing Rosetta, I initially used it by adding a custom flag to commands like this arch -x86_64
. This worked for me but was really error prone, “Did I forget the flag? Did I add the flag in the correct place?”.
This document describes solving M1 Mac vs Intel Mac terminal command discrepancies by creating a copy of your terminal and setting it up to run Intel Mac terminal commands using Rosetta. Although the process of making a Rosetta termi
import unittest | |
import os | |
from zipfile import ZipFile | |
from mock import MagicMock, patch, Mock, mock_open | |
# The functions that are tested: | |
def function_to_test_zipfile(example_arg): | |
with ZipFile(example_arg, 'r') as zip_in: | |
for input_file in zip_in.infolist(): |
[EDIT: I've added a part 2 to this blog post, to address some of the feedback that has come up: https://gist.github.com/getify/706e5e10822a298375da40f9cc1fa295]
Recently, this article on "The JavaScript Block Statement" came out, and it received some good discussion in a reddit thread. But the general reaction seems to be against this approach. That saddens me.