Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View davydog187's full-sized avatar
🍍
Still Elixirin'

Dave Lucia davydog187

🍍
Still Elixirin'
View GitHub Profile
@davydog187
davydog187 / enum.ex
Created August 12, 2020 13:35
Enum type
defmodule App.Ecto.Atom do
@moduledoc """
Generates an Ecto custom type for atoms.
e.g.
defmodule MyType do
use App.Ecto.Atom, values: [:one, :two, :three]
end

Keybase proof

I hereby claim:

  • I am davydog187 on github.
  • I am davydog187 (https://keybase.io/davydog187) on keybase.
  • I have a public key ASCubMQiKyFLw51a6aaD4uJXgcFPAhFbgDwoHgPd-bNEjAo

To claim this, I am signing this object:

@davydog187
davydog187 / .spacemacs
Created December 6, 2018 19:06
Spacemacs 12/6
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
@davydog187
davydog187 / .spacemacs
Created December 4, 2018 15:55
Dave's .spacemacs file 12/4/18
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@davydog187
davydog187 / .bashrc
Created January 20, 2018 22:55
Edited bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@davydog187
davydog187 / .vimrc
Created January 20, 2018 22:55
Stripped down vimrc for ubuntu
" .vimrc
" !silent is used to suppress error messages if the config line
" references plugins/colorschemes that might be missing
" Disable Vi compatibility
set nocompatible
if has("autocmd")
" Load files for specific filetypes
@davydog187
davydog187 / gist:facf3181d8ff5e9371f931b42ca4bc86
Last active September 22, 2016 14:41
digiday remove filter bookmartlet
javascript:(function() {const ads = Array.from(document.querySelectorAll(".ad-wrapper")).forEach(ad => ad.parentNode.removeChild(ad));const blur = Array.from(document.querySelectorAll(".entry-content")).forEach(thing => thing.style.webkitFilter = "none");})();
@davydog187
davydog187 / prototype.js
Created October 21, 2015 17:35
explain how prototype works
function test() {}
test.prototype.number = 5;
var a = new test
var b = new test
b.number // 5
b.hasOwnProperty("number") // false <- false because number is on the prototype
b.number = 10 // now were assigning to number, putting it on the instance
function makeBootstrappingLoader(scriptBody, clientAppUrl, isAsync) {
var loadAsync = isAsync ? "s.async = true;\n" : "";
return "<script type=\"text/javascript\">\n" +
"var s = document.createElement(\"script\");\n" +
"s.setAttribute(\"src\", \"" + clientAppUrl + "\");\n" +
"document.body.insertBefore(s, null)\n"+
loadAsync +
"function loaded(e) {\n" +
scriptBody + "\n" +
"s.removeEventListener(\"load\", loaded, false);\n" +
@davydog187
davydog187 / gpt-leak.html
Created May 13, 2015 19:32
GPT Related Memory Leak
<html>
<head>
<title>GPT Test Page</title>
</head>
<body>
<div id="01dff7272bfc464224240bc6f1f8d25b"></div>
<button id="refresh">Clear and Refresh</button>
<span>Times refreshed: </span><span id="times">0</span>