Skip to content

Instantly share code, notes, and snippets.

View mpan-wework's full-sized avatar
🙃
Think differently

Mike Pan mpan-wework

🙃
Think differently
View GitHub Profile
#!/usr/bin/env python
import os
import os.path
import re
import shutil
import sys
def clean():
dist = 'dist'
@mpan-wework
mpan-wework / RailsPgRedisDocker.md
Created March 10, 2019 07:29
redis-pg-redis-docker

Config Rails to use Postgres and Redis in docker

@mpan-wework
mpan-wework / FakeRedis.md
Last active December 20, 2018 02:36
Fake redis in rspec

Rails cache:

The main methods to call are clear, read, write, delete, exist?, and fetch.

class FakeRedis
  def initialize; @data = {}; end

  def read(key, *args) @data[key] end
 def write(key, val, *args) @data[key] = val end