Skip to content

Instantly share code, notes, and snippets.

@jc00ke
jc00ke / op-gpg
Created Sep 26, 2020
Import 1Password's GPG key on Ubuntu
View op-gpg
#!/usr/bin/env bash
# Necessary to use the MIT keyserver on Ubuntu 20.04/Regolith 1.4 with gpg
gpg --keyserver hkp://pgp.mit.edu --recv-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22
View game.ex
def answer_question(%Game{current_question: current_question} = game, guess, user_name)
when is_binary(guess) do
game
|> Response.new(guess, user_name)
|> answer_question(game, user_name)
end
defp answer_question(%Response{correct: true} = response, game, user_name) do
game =
game
View foo.ex
defmodule Foo do
def bar(:a, opts \\ []), do: :a
def bar(:b, opts \\ []), do: :b
end
@jc00ke
jc00ke / gist:06fba53f3c8571c7bcbeb5de0e59be77
Created Mar 14, 2020
Convert MOV files to other formats
View gist:06fba53f3c8571c7bcbeb5de0e59be77
> ffmpeg -i proj03.mov -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 proj03.ogg
> ffmpeg -i proj03.mov -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis proj03.webm
> ffmpeg -i proj03.mov -vcodec h264 -acodec mp2 proj03.mp4
View arch-install
#!/bin/bash
# Recommended steps:
#
# bootstrap before entering chroot
# copy this script into INSTALL_DIR
# rootinit after entering chroot
# x (if installing graphics)
# pkgs
# xpkgs (if installing graphics)
@jc00ke
jc00ke / install-vim8.txt
Last active Jan 23, 2020 — forked from opchav/install-vim8.txt
Install Vim 8 with Python, Python 3, Ruby and Lua support on Regolith/Ubuntu 19.04
View install-vim8.txt
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@jc00ke
jc00ke / .projections.json
Created Nov 18, 2019 — forked from germsvel/.projections.json
Elixir/Phoenix basic projections
View .projections.json
{
"lib/**/views/*_view.ex": {
"type": "view",
"alternate": "test/{dirname}/views/{basename}_view_test.exs",
"template": [
"defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}View do",
" use {dirname|camelcase|capitalize}, :view",
"end"
]
},
@jc00ke
jc00ke / archdual.sh
Created Jun 14, 2019 — forked from altercation/archdual.sh
arch-dual drive config
View archdual.sh
#!/bin/sh
#----------------------------------------------------------------------
# Arch Linux Installation Script
#
# This installs, with no intervention (other than initial edit to change
# RAID array drive values), Arch Linux on an encrypted btrfs raid1 array.
#----------------------------------------------------------------------
set -eu
@jc00ke
jc00ke / bulletproof_arch.txt
Created Jun 14, 2019 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
View bulletproof_arch.txt
These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (Lenovo P50)
but the setup should work for most laptop/desktop configurations.
Some assumptions/notes:
1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given
the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would
recommend steering clear of dual boot. Just my two cents here.
2. We're encrypting with LUKS. I've used so-called "self encrypting drives" as well (and linux has multiple ways of dealing
View table_live.ex
# from https://github.com/joerichsen/phoenix_live_view_example/blob/be9315feb30f377fb144b1b03b2f93f792bfbfa7/lib/demo_web/live/table_live.ex
defmodule DemoWeb.TableLive do
use Phoenix.LiveView
def render(assigns) do
~L"""
<form phx-change="search"><input type="text" name="query" value="<%= @query %>" placeholder="Search..." /></form>
<table>
<thead>