Skip to content

Instantly share code, notes, and snippets.

View cloudsben's full-sized avatar
🏠
Working from home

Ben cloudsben

🏠
Working from home
View GitHub Profile
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active January 17, 2024 23:54
Simple Authentication in Rail 4 Using Bcrypt

#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

@scturtle
scturtle / txt2epub.py
Created September 10, 2011 07:17
txt to epub
# coding: utf-8
import os
#书籍信息
title='test book'
creator='scturtle'
description='blablablabla'
#章节文件
txtlist=['1.txt','2.txt']
@napcs
napcs / .tmux.clipboard
Created August 15, 2011 19:28
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@Juan931
Juan931 / ABC.md
Created May 6, 2021 00:45 — forked from jdnichollsc/ABC.md
The Job Interview Guide

The Job Interview Guide 💼

And English is a Work in Progress ⌛

@timcharper
timcharper / ido-other-window.el
Created July 28, 2010 03:17
Invoke any command using ido in other window / split window, deciding after the fact instead of before
;; This makes ido-find-file-other-window,
;; ido-switch-buffer-other-window, et. al obsolete. It’s a much better
;; abstraction, and I believe it should become apart of ido mode,
;; because any command that uses ido-completing-read can benefit from
;; it without any additional effort, including textmate.el’s
;; textmate-goto-symbol.
(require 'ido)
@DTrejo
DTrejo / top3stories.js
Created January 21, 2011 22:41
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@samdark
samdark / HmvcController.php
Created August 3, 2011 22:36
Yii: Simple HMVC
<?php
/**
* Yii, simple HMVC
*/
class HmvcController extends Controller
{
public function actionIndex()
{
echo $this->execute('/hmvc/do/id/123');
}
@jasonm23
jasonm23 / powerline.el
Created June 17, 2012 18:03
Powerline fancy statusline
;;; mainline.el --- modeline replacement forked from powerline.el
;; Author: Jason Milkins
;; Version: 1.0.2
;; Keywords: statusline / modeline
;;; Changelog:
;; 1.0.1 : added additional xpm shape chamfer14, adjusted chamfer xpm.
;; : mainline-color1, mainline-color2, mainline-arrow-shape
@matsuda
matsuda / 1_install_homebrew.log
Last active December 29, 2015 05:39
log of setup Homebrew and install development tools in Marvericks
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press ENTER to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir /usr/local
WARNING: Improper use of the sudo command could lead to data loss
@hjue
hjue / my_tmux
Last active December 16, 2015 17:41
my tmux shell
#!/bin/sh
#
cmd=$(which tmux)
session=hjue
if [ -z $cmd ]; then
echo "You need to install tmux."
exit 1
fi