Skip to content

Instantly share code, notes, and snippets.

View geoffgom's full-sized avatar

Geoffroy Gomet geoffgom

  • WebApart
  • Belgium
View GitHub Profile
@geoffgom
geoffgom / .dockerignore
Created April 12, 2018 13:27 — forked from davidderus/.dockerignore
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@geoffgom
geoffgom / 42-things.md
Created October 26, 2017 08:28 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/usr/bin/env node
var cordova_util = require('cordova/src/util');
var ConfigParser = require('cordova/src/ConfigParser');
var projectRoot = cordova_util.isCordova(process.cwd());
var projectXml = cordova_util.projectConfig(projectRoot);
var projectConfig = new ConfigParser(projectXml);
projectConfig.name();
var fs = require ('fs');