Skip to content

Instantly share code, notes, and snippets.

View lukeorland's full-sized avatar

Luke Orland lukeorland

View GitHub Profile
@richkuz
richkuz / insert-date-mac-osx.md
Created June 12, 2020 15:35
Insert ISO-8601 formatted date yyyy-mm-dd on Mac OSX using a keyboard shortcut

Recently, I converted to using ISO-8601 formatted dates as much as possible, e.g. 2020-06-12. As a meme, I hope this catches on. Dates written this way are internationally recognizable, no confusion over mm/dd/yy or dd/mm/yy. They are sortable. And, when used consistently, they are easy to search; no worries about case sensitivity, or Jun/June spellings. Don’t take my word for it, though. Randall Munroe agrees. So does GitLab.

Here's how to create a keyboard shortcut to insert the current date formatted as ISO-8601.

  1. Launch Automator, and create a new Service.

  2. This particular service receives no input.

  3. Drag in Run AppleScript to the service.

@gigasquid
gigasquid / gpt2.clj
Created January 10, 2020 21:45
GPT2 with libpython-clj
(ns gigasquid.gpt2
(:require [libpython-clj.require :refer [require-python]]
[libpython-clj.python :as py]))
;https://huggingface.co/transformers/quickstart.html - OpenAI GPT-2
(require-python '(transformers))
(require-python '(torch))
@gigasquid
gigasquid / mxnet.clj
Last active January 14, 2020 19:43
libpython-clj-mxnet
(ns gigasquid.mxnet
(:require [libpython-clj.require :refer [require-python]]
[libpython-clj.python :as py]
[clojure.string :as string]))
(require-python '(mxnet mxnet.ndarray mxnet.module mxnet.io))
(require-python '(mxnet.test_utils))
(require-python '(mxnet.initializer))
(require-python '(mxnet.metric))
(require-python '(mxnet.symbol))
@ngm
ngm / packages.el
Last active November 13, 2019 21:44
Basic spacemacs org-brain layer
;; put this file in ~/.emacs.d/private/org-brain
;; then add org-brain into your dotspacemacs-configuration-layers in .spacemacs
(defconst org-brain-packages
'(org-brain)
)
;; see https://github.com/Kungsgeten/org-brain#setup-and-requirements
(defun org-brain/init-org-brain ()
(use-package org-brain
@alexhayes
alexhayes / pyenv+direnv on OSX.md
Last active November 6, 2022 20:17
Awesomely easy virtualenvs on OSX using pyenv and direnv

Awesomely easy virtualenvs on OSX using pyenv and direnv

Never forget to activate that virtualenv or set that environment variable ever again...

Install

  1. Install pyenv

     brew install pyenv
    
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@BernardNotarianni
BernardNotarianni / spacemacssheet.tex
Last active August 22, 2017 13:25
Spacemacs Cheat Sheet
\documentclass[10pt,landscape]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage[landscape]{geometry}
\usepackage{hyperref}
% based on latex cheat sheet https://wch.github.io/latexsheet/
%
% To make this come out properly in landscape mode, do one of the following
@kevinswiber
kevinswiber / alps.json
Last active October 12, 2016 17:19
Zetta Metadata to ALPS Mapping
{
"alps": {
"version": "1.0",
"descriptor": [
{
"id": "led-type",
"name": "led",
"type": "semantic",
"descriptor": [
{
@robtimp
robtimp / smartquotes.swift
Created May 11, 2015 22:11
Swift smart quotes
// Light-weight Swift smart quote implementation
// By Rob Hudson
// 5/11/2015
import UIKit
let text = "\"Would you tell me, please, which way I ought to go from here?\" " +
"That depends a good deal on where you want to get to,\" said the Cat. " +
"\"I don’t much care where-\" said Alice. " +
"Then it doesn’t matter which way you go,\" said the Cat. " +
@abn
abn / heredoc-dockerfile.snip
Last active June 16, 2024 22:01
Dockerfile alternatives for heredoc
#printf
RUN printf '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
>> /tmp/hello
#echo
RUN echo -e '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\