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 ApplicationController < ActionController::Base | |
protect_from_forgery prepend: true, with: :exception | |
private | |
def smart_backlink_session | |
# Clear all other links when on home page - my preference | |
delete_session_paths_visited_if_on_dashboard | |
route_name = Rails.application.routes.router.recognize(request) { |route, _| route.name }.flatten.last.name | |
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
<% paths = session[:paths_visited] %> | |
<% path_index = paths.index(@path_name) %> | |
<% url = paths[path_index - 1].split("|").first %> | |
<% named_route = paths[path_index - 1].split("|").last %> | |
<% capitalize_text = named_route.gsub("_", " ").split.map(&:capitalize).join(" ") %> | |
<div class="body--padding"> | |
<%= link_to "Back to #{capitalize_text}", url if not current_page?(dashboard_path) %> | |
</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
# In our gemfile: | |
# gem 'rubyzip' | |
require 'zip' | |
# private ? | |
def process_and_create_zip_file | |
# Simulation of an object with has_many_attached :documents | |
job = Job.first.documents | |
# Tmp folder to store the download files from S3 |
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
Homebrew build logs for python on macOS 10.14.2 | |
Build date: 2018-05-19 07:06:25 |
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
<!-- | |
* A Simple Star Rating VueJs Component | |
* | |
* @author Daveyon Mayne ([email protected]) | |
* Some code borrowed from https://gist.github.com/FGRibreau/1748259 (x.times()) | |
* | |
--> | |
<template lang="html"> | |
<div class="svg-star"> |
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
/** | |
* Delete an image from the S3 Bucket | |
* | |
* @author Daveyon Mayne <@MirMayne> | |
* @date July 14th 2019 | |
*/ | |
const AWS = require('aws-sdk'); | |
const deletePhoto = async (avatar_url) => { |
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 | |
# This file must be locatated inside your project | |
# and there must be at least one branch: master. | |
# Make this file executable with | |
# chmod +x artifact.sh | |
# Branch to archive. | |
# Defaults to master branch if no param passed ie: |