Skip to content

Instantly share code, notes, and snippets.

View abhionlyone's full-sized avatar
:octocat:
Focusing

Abhilash Reddy abhionlyone

:octocat:
Focusing
View GitHub Profile
@adamjstevenson
adamjstevenson / stripe_js_bootstrap.html
Last active April 15, 2020 07:56
Stripe.js bootstrap example -- simple
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Stripe.js example form</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1>A simple Bootstrap Stripe.js payment form</h1>
@logrusorgru
logrusorgru / gist:9867976
Last active December 16, 2022 02:54
Rails - How to check for online users? Redis.

Rails - How to check for online users? Redis.

Init Redis

   # config/initializers/redis.rb
    
   $redis_onlines = Redis.new
   # it's the simplest way, but i'd recommend:
   # $redis_onlines = Redis.new path: "/tmp/redis.sock", db: 15, driver: :hiredis
@nosolopau
nosolopau / deploy.rb
Created January 8, 2014 11:02
Send email notifications after deploy (with Capistrano and Rails 4). Capistrano variables reference: http://theadmin.org/articles/capistrano-variables/
# Add the following lines at the end of config/deploy.rb
Dir["config/deploy/extras/*.rb"].each { |file| load file }
set :notify_emails, ["mail@example.com"]
after "deploy", "deploy:notify"
@millermedeiros
millermedeiros / osx_setup.md
Last active May 7, 2024 08:01
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@henrik
henrik / hash_deep_diff.rb
Created July 14, 2009 08:38
Recursively diff two Ruby hashes.
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {