Skip to content

Instantly share code, notes, and snippets.

View Rooarii's full-sized avatar
✌️
Declare variables, not War ! 🇺🇦

Rooarii MANUEL Rooarii

✌️
Declare variables, not War ! 🇺🇦
View GitHub Profile
# It's only a POC for now
defmodule ContextBase do
@moduledoc """
Abstracts away common schema functions, such as list, get, create, update, delete, etc.
Assumes that the schema module has a `changeset` function.
Usage:
defmodule MyContext do
use ContextBase, repo: MyApp.Repo, schema: MyApp.MySchema
end
@blakazulu
blakazulu / style.js
Last active February 7, 2021 08:54
Console Style
var style = "font-size: 24px;" +
"background: #67b26f; /* fallback for old browsers */" +
"background: -webkit-linear-gradient(to right, #67b26f, #4ca2cd); /* Chrome 10-25, Safari 5.1-6 */" +
"background: linear-gradient(to right, #67b26f, #4ca2cd); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */" +
"color: white;" +
"text-align: center;" +
"padding: 10px 15px;" +
"width: 100%;" +
"border-radius: 20px;";
@houkanshan
houkanshan / del-console.sh
Created October 9, 2013 15:14
Clear "console.log" before `git commit`, and recover them after `git commit`, add them to git-hooks file: pre-commit & post-commit ~
#!/bin/sh
debug_rex='/console.log/'
debug_print_rex=$debug_rex'p'
debug_del_rex=$debug_rex' d'
add_debug_patch='.add-debug.patch'
del_debug_patch='.del-debug.patch'
git_work_dir="$(git rev-parse --show-toplevel)"
fake_file="$git_work_dir/.fake_file"
cur_dir="$(pwd)"