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/views/custom/_custom_application.html.erb %> | |
<!DOCTYPE html> | |
<!--[if lt IE 7 ]> <html class="ie ie6" lang="<%= I18n.locale %>"> <![endif]--> | |
<!--[if IE 7 ]> <html class="ie ie7" lang="<%= I18n.locale %>"> <![endif]--> | |
<!--[if IE 8 ]> <html class="ie ie8" lang="<%= I18n.locale %>"> <![endif]--> | |
<!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]--> | |
<!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]--> | |
<html> | |
<head data-hook="inside_head"> |
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
/** | |
* If any issues, be sure to import Firebase or FirebaseAuth and check your Podfile | |
* | |
*/ | |
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) { | |
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) | |
let root = UIApplication.shared.keyWindow?.rootViewController | |
let lc: LoginVC = storyboard.instantiateViewController(withIdentifier: "loginVC") as! LoginVC | |
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
import UIKit | |
import Firebase | |
import SwiftKeychainWrapper // I use this | |
class LoginVC: UIViewController, UITextFieldDelegate { | |
// Where our shortcutItem.type is stored | |
var params: String! = "" | |
// Your @IBAction button function |
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 NotificationWorker | |
include Sidekiq::Worker | |
include Facebook::Messenger | |
def perform | |
token = ENV["ACCESS_TOKEN"] | |
sender_id = '12345' | |
text = # "Your reminder to brush your teeth is in 5 mins" | |
standard_text(sender_id, text, token) | |
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
#<ActionDispatch::Http::Headers:0x007fb2ee2e01c8 @req=#<ActionDispatch::Request:0x007fb2ee353600 @env={"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"puma 3.8.2 Sassy Salamander", "GATEWAY_INTERFACE"=>"CGI/1.2", "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/fake", "REQUEST_URI"=>"/fake", "HTTP_VERSION"=>"HTTP/1.1", "HTTP_ACCEPT"=>"application/json, text/plain, */*", "HTTP_USER_AGENT"=>"axios/0.16.1", "HTTP_HOST"=>"localhost:3001", "HTTP_CONNECTION"=>"close", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3001", "PATH_INFO"=>"/fake", "REMOTE_ADDR"=>"127.0.0.1", "puma.socket"=>#<TCPSocket:fd 22>, "rack.hijack?"=>true, "rack.hijack"=>#<Puma::Client:0x3fd9769617cc @ready=true>, "rack.input"=>#<Puma::NullIO:0x007fb2ee332ab8>, "rack.url_scheme"=>"http", "rack.after_reply"=>[], "puma.config"=>#<Puma::Configuration:0x007fb2eeba88c8 @options=#<Puma::U |
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
Spree::CheckoutController.class_eval do | |
before_filter :get_xero | |
# https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/checkout_controller.rb | |
# Updates the order and advances to the next state (when possible.) | |
# Modified to use Xeroizer | |
def update | |
if @order.update_from_params(params, permitted_checkout_attributes, request.headers.env) | |
@order.temporary_address = !params[:save_user_address] | |
unless @order.next |
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
/* | |
* .navbar is the name of our component | |
* | |
*/ | |
.navbar { | |
height: 90px; | |
// .navbar__container | |
&__container { | |
display: flex; |
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
<nav class="navbar"> | |
<div class="navbar__container"> | |
<div class="navbar__container__logo"> | |
<a class="navbar__container__logo--svg" href="#">Logo</a> | |
</div> | |
<div class="navbar__container__links"> | |
<a class="navbar__container__links--home" href="#">Home</a> | |
<a class="navbar__container__links--about" href="#">About</a> | |
<a class="navbar__container__links--terms" href="#">Terms</a> | |
</div> |
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
# Generated from your Rails Console | |
# salt = SecureRandom.random_bytes(64) | |
# key = ActiveSupport::KeyGenerator.new('password').generate_key(salt) | |
SALT: "\xF9\x9B:\xB6\x0F\xAE\xD9\t(\xA2\xB9\nC&\xF6|\xDC\b\b\xA3\x96\x83\xF4\xDE,\xE1\x86{\xFE\e\x16\x8B'\x1DR\v\x10\x11?v\xE4\xB1A\xEEG^X\x8B\xF3\xCE\x9AQ\xCDyJ\xEC\xF4\x01\xB1\xBD\x9CU\xE2\xAE" | |
KEY: "x\xFF=o\xF3\x90p\xA6)\x13p\x8B\x9A\xB7tU\xDF\xC2\xDF2=s\xA4[\x80\xCA\xBF\x1A|\x0E\xEEq\xE0\xFC\xBDq\x85i\xC5\xE1 \xE5\xE5+Nm;\xAA\x99\xFF9\x13\xBFdh\x97\xBC\x942\xBF\x10\xF3\xAC\xAE" |
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
/** | |
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from | |
* a base64 string. | |
* Updated to use Promise (bluebird) | |
* Web: https://mayneweb.com | |
* | |
* @param {string} base64 Data | |
* @return {string} Image url | |
*/ | |
const imageUpload = async (base64) => { |
OlderNewer