Skip to content

Instantly share code, notes, and snippets.

View SylarRuby's full-sized avatar

Daveyon Mayne SylarRuby

  • UK
View GitHub Profile
@SylarRuby
SylarRuby / SignInViewModel.swift
Last active November 12, 2022 10:56
Turbo-iOS Native Authentication View, not modally presented
//
// SignInViewModel.swift
//
// Created by @SylarRuby on 11/11/2022.
//
// This a continuation of https://masilotti.com/turbo-ios/native-authentication/.
// Instead of showing a modal for the form to sign in, we replace the all views
// with the sign in screen/view.
import Foundation
@SylarRuby
SylarRuby / post.hbs
Created June 29, 2021 06:45
Ghost Post Page with Feature Image At Top
{{!< default}}
<!-- Move style into a stylesheet or inside the site header code injection -->
<style>
.article {
padding: 0;
}
figure.article-image {
margin-bottom: 3em;
@SylarRuby
SylarRuby / artifact.sh
Last active March 2, 2021 20:09
Creates a tar file for your git repository then copies to a remote server.
#!/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:
@SylarRuby
SylarRuby / deleteAvatar.js
Last active December 13, 2022 17:11
Deletes a s3 bucket object by a known unique key 💥
/**
* 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) => {
@SylarRuby
SylarRuby / rating.vue
Created March 2, 2019 08:20
A Simple Star Rating VueJs Component
<!--
* A Simple Star Rating VueJs Component
*
* @author Daveyon Mayne (hello@mayneweb.com)
* Some code borrowed from https://gist.github.com/FGRibreau/1748259 (x.times())
*
-->
<template lang="html">
<div class="svg-star">
@SylarRuby
SylarRuby / # python - 2018-05-19_07-06-25.txt
Created January 29, 2019 09:53
python on macOS 10.14.2 - Homebrew build logs
Homebrew build logs for python on macOS 10.14.2
Build date: 2018-05-19 07:06:25
@SylarRuby
SylarRuby / ToolTipShare.js
Created December 28, 2018 05:29
a medium-like popover used at mayneweb.com
/**
* A Medium-like popover for a react application
* You are free to distribute and modify the code here-in.
*
* @author Daveyon Mayne <hello@mayneweb.com> https://www.mayneweb.com
* svg by Medium.com
*/
import React, { Component } from 'react'
@SylarRuby
SylarRuby / tooltip-share.scss
Created December 27, 2018 06:02
Tooltip/Popover Style
/**
* Stylesheet for a blog post entitled A Medium-like Popover Without Any Dependencies on
* https://www.mayneweb.com/p/a-medium-like-popover-without-any-dependencies/
*
* @auther Daveyon Mayne <hello@mayneweb.com>
*/
.ToolTipShare {
position: absolute;
visibility: hidden;
@SylarRuby
SylarRuby / downloads_controller.rb
Last active August 25, 2022 06:43
Loop through all, zip and download from ActiveStorage
# 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