Skip to content

Instantly share code, notes, and snippets.

View aaronjensen's full-sized avatar

Aaron Jensen aaronjensen

View GitHub Profile
@aaronjensen
aaronjensen / GNU-Emacs-25.1-OS-X-enable-vfork.patch
Last active April 10, 2017 14:23
Significantly speeds up call-process, making magit much faster. May not be safe. See http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-04/msg00201.html for more info
Use vfork if possible on Darwin
src/conf_post.h: Remove defines forcing use of fork.
src/process.c (create_process): Use fork if pty_flag is set, otherwise
vfork.
---
src/conf_post.h | 6 ------
src/process.c | 9 +++++++++
2 files changed, 9 insertions(+), 6 deletions(-)
export class Endpoint<TResponse> {
url: string
method: RequestMethod
constructor({ url, query = {}, method = 'GET' }: RequestProps) {
const qs = queryString.stringify(query)
this.url = qs ? `${url}?${qs}` : url
this.method = method
}
}
/* eslint-disable camelcase */
const webpack = require('webpack')
const path = require('path')
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')
const nodeEnv = process.env.NODE_ENV || 'development'
const svgoConfig = require('./svgo.config')
// This won't type check even when correct
export default function reducer(state: SessionState = initialState, action: SetCurrentUserAction): SessionState {
let newState
switch (action.type) {
case 'SET_CURRENT_USER':
newState = { loaded: true, currentUser: action.payload }
}
return newState
}
defmodule Executable do
@moduledoc """
Executables are either commands or queries.
They should declare a struct that dictates the shape and defaults of their
parameters and a `handle_execute/1` function that takes that struct and does
something in response.
"""
use Behaviour
FROM erlang:19.1-slim
ENV GOSU_VERSION 1.9
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
;; Runs eslint --fix after save
(defun eslint-fix ()
(interactive)
(let ((current-point (point))
(line (count-screen-lines (window-start) (point)))
(command (concat
flycheck-javascript-eslint-executable
" --stdin"
" --fix-to-stdout"
" --stdin-filename " buffer-file-name))
(defun eslint-fix ()
(interactive)
(let ((current-point (point)))
(unless (eq 0
(shell-command-on-region
;; Region
(point-min)
(point-max)
;; Command
(concat
### Keybase proof
I hereby claim:
* I am aaronjensen on github.
* I am aaronjensen (https://keybase.io/aaronjensen) on keybase.
* I have a public key whose fingerprint is CE10 E037 2319 0093 68D6 7704 395C F9A7 19B6 724C
To claim this, I am signing this object: