Skip to content

Instantly share code, notes, and snippets.

View robinkanters's full-sized avatar
🇳🇴

Robin Kanters robinkanters

🇳🇴
View GitHub Profile
@robinkanters
robinkanters / openpgp.txt
Created October 28, 2017 14:44
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:37c83b52bb4a8258549cd9e0e004441037451982]
@robinkanters
robinkanters / openpgp.txt
Created October 28, 2017 14:44
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:37c83b52bb4a8258549cd9e0e004441037451982]
@robinkanters
robinkanters / gen.sh
Last active March 23, 2017 09:52
generate 2048-bit rsa key (saves them in files names 'key_private' and 'key_public')
openssl genrsa 2048 | tee key_private >(openssl rsa -pubout > key_public) > /dev/null

Install Chocolatey:

In cmd.exe:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Or in powershell:

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Install Elixir:

choco install elixir

class AbstractTool is
function moveTo(point) is
input: the location point the mouse moved to
(this function must be implemented by subclasses)
function mouseDown(point) is
input: the location point the mouse is at
(this function must be implemented by subclasses)
function mouseUp(point) is
@robinkanters
robinkanters / router.php
Last active December 10, 2015 12:45
PHP debug server router script for Prestashop
<?php
define('_PS_ADMIN_DIR_', __DIR__.'/iadmin/');
$url = $originalUrl = preg_replace('/^(.*)\?.*$/', '$1', $_SERVER['REQUEST_URI']);
$stdout = fopen('php://stdout', 'w');
$stderr = fopen('php://stderr', 'w');
$matches = [];

#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

languages:
PHP: true
exclude_paths:
- "app/SymfonyRequirements.php"
- "web/app_dev.php"
- "app/check.php"
- "web/config.php"