Skip to content

Instantly share code, notes, and snippets.

View AustineA's full-sized avatar
🎯
Focusing

Austine A. AustineA

🎯
Focusing
View GitHub Profile
@avosalmon
avosalmon / firebase_token.rb
Last active March 4, 2024 06:54
Verify Firebase auth JWT token
require 'base64'
require 'httparty'
require 'jwt'
class FirebaseToken
JWT_ALGORITHM = 'RS256'.freeze
PUBLIC_KEY_URL = 'https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com'.freeze
def initialize(token)
@token = token
<script>
// .vue files typically have 3 section
// 1.template - markup, 2.script - js, 3.style - css
// we are importing the csrf component it has two hidden input fields
// for csrf token and utf encoding
// creating a component helps us reuse it in multiple forms
import CSRF from 'components/shared/csrf.vue';
export default {
@underhilllabs
underhilllabs / sinatra_dokku.md
Last active December 7, 2023 16:19
Setting up a Sinatra app on Dokku

There are a few additional steps I noticed to setting up a Sinatra app to work on Dokku. (These are probably also required for deploying an app to Heroku.)

original app.rb

require 'sinatra'

get '/' do
  "Your Sinatra app is not quite Dokku-fied!"
end
@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

@thagxt
thagxt / AJAX add to cart button on Shop page in WooCommerce.php
Created April 3, 2014 14:27
AJAX add to cart button on Shop page in WooCommerce
WTF: Get the AJAX add to cart button on Shop/Category/Search pages in WooCommerce. (AJAX works only for simple products)
HOW:
1) create a directory, name it "woocommerce" put it in your theme root.
2) copy/pasta from woocommerce plugin directory the content-product.php file
3) at the end of the (content-product.php) file, paste the code below:
<?php
global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',