Skip to content

Instantly share code, notes, and snippets.

View alexkrolick's full-sized avatar
🏔️
I may be slow to respond.

Alex Krolick alexkrolick

🏔️
I may be slow to respond.
View GitHub Profile
@alexkrolick
alexkrolick / embed.tex
Last active December 21, 2015 21:59
How to attach a .tex source file to a PDF generated via pdflatex.
\usepackage{embedfile} % for attaching the .tex file to the PDF
\embedfile{\jobname.tex} % embed the source
@alexkrolick
alexkrolick / template.tex
Last active December 21, 2015 22:08
Basic LaTex template
\documentclass[11pt,letterpaper]{article}
%DOCUMENT INFORMATION
\title{Document Title}
\author{First Author Name \and Second Author Name}
\date{\today}
%PACKAGES
\usepackage{graphicx} % for images
\usepackage{fullpage} % 1" margins

Keybase proof

I hereby claim:

  • I am alexkrolick on github.
  • I am krolick (https://keybase.io/krolick) on keybase.
  • I have a public key whose fingerprint is C812 6A18 8976 B0CF 029F C880 B074 92C5 FC3B FD70

To claim this, I am signing this object:

@alexkrolick
alexkrolick / index.html
Created September 8, 2016 17:28
Quill Playground
<div id="editor-container"></div>
<form submit="#">
<input type="hidden" id="myHtml"/>
<button type="submit">Submit</submit>
</form>
@alexkrolick
alexkrolick / webpack.config.js
Last active July 13, 2017 04:11
Webpack Config for Webpack-Rails + CDN for production (Webpack 1.x - some minor differences may be encountered for Webpack 2+)
const CDN = process.env['CDN_HOST'] || '';
/**
* Webpack configuration for integrating Webpack with Rails via the webpack-rails gem
* (https://github.com/mipearson/webpack-rails)
*
* Cache-Busting Strategy:
* Development: Change query string of resource when content MD5 hash changes,
* rewriting the asset in place but triggering rewrite of the manifest.
* Production: Use MD5 hash of asset as filename, writing new assets and manifest
@alexkrolick
alexkrolick / replaceUrlSearchParam.js
Last active November 18, 2020 08:10
Replaces the search parameter in browser URL (?param=value)
/**
* Replace browser's URL search parameter. Expects jQuery, $, or window to have .param
* defined or it will only URIencode strings and error on other types.
*/
function replaceUrlSearchParams(newParams) {
var url;
if (typeof window.URL === "function") {
url = new URL(window.location.href);
} else {
// Workaround for browsers without URL constructor:
@alexkrolick
alexkrolick / .zshrc
Last active March 8, 2023 19:26
.zshrc
# Installation
#
# MacOS
#
# mkdir ~/.zsh
# brew install zsh-syntax-highlighting zsh-completions
# touch ~/.zshrc
# touch ~/.profile
#
# Paste this file into `~/.zshrc`
@alexkrolick
alexkrolick / index.html
Last active October 15, 2018 16:20
React-Quill Demo
<div class="app">
</div>
@alexkrolick
alexkrolick / async-test.js
Last active February 28, 2018 21:24
Async-Await vs Promises in Node
// Before April 2017 run this with flags:
// node --harmony-async-await ./async-test.js
function sayHi (name) {
if (name == null) throw Error('Missing name')
return `Hi ${name}.`
}
function sayWhatsUpAsync (msg, timeoutMs) {
console.log(`Will return in ${timeoutMs / 1000}s`)
@alexkrolick
alexkrolick / .gitconfig
Last active July 7, 2018 22:36
Git aliases and tool config
[diff]
tool = vscode
indentHeuristic = true
algorithm = histogram
[difftool]
prompt = false
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
keepBackup = false