Skip to content

Instantly share code, notes, and snippets.

@alagram
alagram / gist:abb1a7832adfa03e225f8cec3018e385
Created March 11, 2020 10:05 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@alagram
alagram / example_job.rb
Last active February 3, 2019 03:12 — forked from wrburgess/example_job.rb
ActiveJob on Rails 5 with RSpec
# app/jobs/example_job.rb
class ExampleJob < ActiveJob::Base
queue_as :default
rescue_from(ActiveRecord::RecordNotFound) do
retry_job wait: 1.minute, queue: :default
end
def perform(param_1, param_2)
@alagram
alagram / docker-pry-rails.md
Created December 18, 2018 15:25 — forked from briankung/docker-pry-rails.md
Using pry-rails with Docker
<div id="main" role="main">
<div class="container">
<div class="row">
<div class="span12" id="top-div"> <!--! added "top-div" id to help with ajax -->
<%= render 'layouts/messages' %>
<%= yield %>
</div>
</div>
<footer>
</footer>
# main.rb
def display_card(card)
first = ''
second = ''
card.each do |x|
if x == 'H'
first = 'hearts'
elsif x == 'C'
post '/bet' do
session[:name] = params[:name]
redirect '/game'
end
get '/game' do
# you'll get the value of session[:name] in your game template
erb :game
end
@alagram
alagram / gist:10653300
Created April 14, 2014 14:30
rackup error
/Users/Albert/Documents/Dev/best_quotes/config/application.rb:4:in `<module:BestQuotes>': uninitialized constant Tracks::Application (NameError)
from /Users/Albert/Documents/Dev/best_quotes/config/application.rb:3:in `<top (required)>'
from /Users/Albert/Documents/Dev/best_quotes/config.ru:1:in `require'
from /Users/Albert/Documents/Dev/best_quotes/config.ru:1:in `block in <main>'
from /Users/Albert/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/Albert/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/Albert/Documents/Dev/best_quotes/config.ru:in `new'
from /Users/Albert/Documents/Dev/best_quotes/config.ru:in `<main>'
from /Users/Albert/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/Albert/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
@alagram
alagram / gist:9889458
Created March 31, 2014 10:23
Add timestamps
# Run this on console
rails generate migration add_timestamsps
# Then change migration file as seen here
class AddTimestamps < ActiveRecord::Migration
def change
add_column :table_name, :created_at, :datetime
add_column :table_name, :updated_at, :datetime
end
end