Skip to content

Instantly share code, notes, and snippets.

View dtran320's full-sized avatar
🌊
Come co-work with us virtually! https://www.flow.club

David Tran dtran320

🌊
Come co-work with us virtually! https://www.flow.club
View GitHub Profile
@dtran320
dtran320 / redis_session_backend.py
Created April 25, 2012 00:39 — forked from mikeyk/redis_session_backend.py
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@dtran320
dtran320 / simple_redis_profile.rb
Created April 25, 2012 00:50 — forked from joeyAghion/simple_redis_profile.rb
By sampling keys from your redis databases, this script tries to identify what types of keys are occupying the most memory.
#!/usr/bin/env ruby
# Evaluates a sample of keys/values from each redis database, computing statistics for each key pattern:
# keys: number of keys matching the given pattern
# size: approximation of the associated memory occupied (based on size/length of value)
# percent: the proportion of this 'size' relative to the sample's total
#
# Copyright Weplay, Inc. 2010. Available for use under the MIT license.
#!/bin/bash
# Use apt-get to install necessary packages for installing from source
set -e
sudo apt-get install libncurses5-dev gcc g++ make
cd ~/
wget http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.36.tar.gz
tar -zxf mysql-5.1.36.tar.gz
@dtran320
dtran320 / error.js
Created October 24, 2018 21:37 — forked from nuevoalex/error.js
Error connecting to Rinkeby node
[ethrpc] http-transport unexpected status code IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,