Skip to content

Instantly share code, notes, and snippets.

@afomi
afomi / .md
Created January 9, 2023 04:01 — forked from mbajur/.md
How to create small, unique tokens in Ruby

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):

@afomi
afomi / ember-rails-scaffold.md
Last active August 29, 2015 14:05 — forked from pixelhandler/ember-rails-scaffold.md
Ember Rails Scaffold

Scaffold for a browser app build with Ember.js, Rails, Ember.Data

Journal App

This is a scaffold for setting up: an API with Rails and the ember-rails gem, persistence with Ember.Data, and a browser app using Ember.js

See source code on GitHub: pixelhandler/journal.

@afomi
afomi / Run in LOCAL terminal...
Last active August 29, 2015 13:55 — forked from jswartwood/Run in LOCAL terminal...
Dreamhost Git Post Hook
# Replace any brackets with real values
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit