- Open the document in Google Docs
- Scroll to the bottom of the document, so all the pages are present
- Open Developer Tools on separate window and choose the Console tab
- Paste the code
- Have fun!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # read more: https://freegeoip.app/ | |
| require 'uri' | |
| require 'net/http' | |
| require 'openssl' | |
| # https://freegeoip.app/{format}/{IP_or_hostname} | |
| url = URI("https://freegeoip.app/json/") | |
| http = Net::HTTP.new(url.host, url.port) | |
| http.use_ssl = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/types/binary_hash.rb | |
| class BinaryHash < ActiveRecord::Type::Binary | |
| def serialize(value) | |
| super value_to_binary(value.to_json) | |
| end | |
| def deserialize(value) | |
| super case value | |
| when NilClass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #set -x | |
| # Shows you the largest objects in your repo's pack file. | |
| # Written for osx. | |
| # | |
| # @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # @author Antony Stubbs | |
| # set the internal field separator to line break, so that we can iterate easily over the verify-pack output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Raw Package | |
| import numpy as np | |
| import pandas as pd | |
| #Data Source | |
| import yfinance as yf | |
| #Data viz | |
| import plotly.graph_objs as go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserMailer < Devise::Mailer | |
| helper :application # gives access to all helpers defined within `application_helper`. | |
| include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url` | |
| default template_path: 'users/mailer' # to make sure that your mailer uses the devise views | |
| def welcome_reset_password_instructions(user) | |
| create_reset_password_token(user) | |
| mail(to: user.email, subject: 'Welcome to the New Site') | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # retrieve subscription data | |
| ######################## | |
| Stripe.api_key = ENV.fetch('STRIPE_SECRET_KEY') | |
| subscriptions = | |
| Stripe::Subscription.list(status: 'all', limit: 100, expand: ['data.customer']) | |
| # Retrieve all subscriptions, following pagination until complete. | |
| .auto_paging_each | |
| .to_a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="bg-gray-600 p-20 h-screen"> | |
| <div class="grid grid-cols-2 gap-12 place-items-center"> | |
| <div class="rounded-lg border-8 border-white h-48 w-48 shadow-lg"> | |
| <div class="h-full w-full bg-gradient-conic-tr from-green-200 via-blue-100 to-green-600"></div> | |
| </div> | |
| <div class="rounded-lg border-8 border-white h-48 w-48 shadow-lg"> | |
| <div class="h-full w-full bg-gradient-conic-tl from-pink-500 via-purple-500 to-blue-500"></div> | |
| </div> | |
| <div class="rounded-lg border-8 border-white h-48 w-48 shadow-lg"> | |
| <div class="h-full w-full bg-gradient-conic-br from-orange-200 via-yellow-500 to-red-500"></div> |