Skip to content

Instantly share code, notes, and snippets.

View elbow-jason's full-sized avatar
🏠
Working from home

Jason Goldberger elbow-jason

🏠
Working from home
View GitHub Profile
@elbow-jason
elbow-jason / redis_cheatsheet.bash
Created October 27, 2018 21:22 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@elbow-jason
elbow-jason / _service.md
Last active October 2, 2016 03:35 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
query = from workout in Workout,
where: workout.id == ^id,
left_join: group in assoc(workout, :workout_set_groups),
left_join: set in assoc(group, :workout_sets),
join: excercise in assoc(group, :excercise),
preload: [workout_set_groups: {group, excercise: excercise, workout_sets: set}]
@elbow-jason
elbow-jason / mnesia.exs
Last active August 29, 2015 14:17 — forked from joshnuss/mnesia.exs
# define a record, first attribute is considered the key
defrecord User, email: "", first: "", last: ""
# encapsulates mnesia calls
defmodule Database do
def create_schema do
create_table User
end
def find(record, id) do