Skip to content

Instantly share code, notes, and snippets.

View kennyadsl's full-sized avatar
❤️
Ruby

Alberto Vena kennyadsl

❤️
Ruby
View GitHub Profile
@benjaminwil
benjaminwil / proposed-solidus-docs-table-of-contents.md
Last active January 23, 2018 23:15
A high-level working draft of Solidus's documentation structure

Proposed table of contents for Solidus documentation

This document is a high-level working draft. Where and how this documentation will exist is still up for discussion.

Note that list items that are crossed out mean that essential documentation for that topic has been merged.

Admin

@lindsaymarkward
lindsaymarkward / install_homebridge.sh
Created April 2, 2017 23:13
Install homebridge on hassbian
#!/bin/bash
echo
echo "Homebridge install script for Hassbian"
echo
if [ "$(id -u)" != "0" ]; then
echo "This script must be run with sudo. Use \"sudo ${0} ${*}\"" 1>&2
exit 1
fi
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@ArunMichaelDsouza
ArunMichaelDsouza / spree.rb
Last active May 9, 2021 04:54
Solidus config for S3 file upload + CDN (Cloudfront) delivery
# Upload new product images to S3 and deliver via Cloudfront
Spree.config do |config|
attachment_config = {
s3_credentials: {
access_key_id: ENV.fetch("S3_ACCESS_KEY"),
secret_access_key: ENV.fetch("S3_SECRET"),
bucket: ENV.fetch("S3_BUCKET"),
},
@ghaiklor
ghaiklor / iterm-fish-fisherman-meslo-osx.md
Last active December 5, 2022 11:14
iTerm 2 + fish + fisherman + Material Design + Meslo
@andychase
andychase / googleforms2slack.gs
Last active February 15, 2024 07:53
Google Forms Slack Notification
// Google Forms Slack Notification
// Andy Chase <github.com/andychase>
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0>
// Install 1: This code goes in ( tools > script editor... ) of your google docs form
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] )
// Setup 1: Put your slack api url below
var POST_URL = "https://hooks.slack.com/services/";
function onSubmit(e) {
@jodosha
jodosha / create_email_test_operation.rb
Last active October 2, 2016 01:06
Interactors proposal
class CreateEmailTest
include Lotus::Interactor
def initialize(params)
@params = params
@email_test = EmailTest.new(@params[:email_test])
end
def call
Operation.new(self, email_test: @email_test).
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@swrobel
swrobel / spree_1.3.3_to_2.0.4.md
Last active December 18, 2018 16:48
HOWTO: Upgrade Spree 1.3.3 to 2.0.4

HOWTO: Upgrade Spree 1.3.3 to 2.0.4

These steps were sufficient to upgrade Cult Cosmetics to Spree 2.0.4 from 1.3.3. Here are some details on our environment.

  • We only have single-variant products
  • We are not making use of stock locations (single warehouse)
  • Frontend entirely overridden w/ custom bootstrap layout
  • Braintree gateway
  • Rails 3.2.14
  • Upgraded from Ruby 1.9.3-p448 to 2.0.0-p247 in the process (no issues)
@bantic
bantic / rails_route_recognizer.rb
Last active September 9, 2022 12:22
Programmatically list all routes (/paths) from within a rails app.
class RouteRecognizer
attr_reader :paths
# To use this inside your app, call:
# `RouteRecognizer.new.initial_path_segments`
# This returns an array, e.g.: ['assets','blog','team','faq','users']
INITIAL_SEGMENT_REGEX = %r{^\/([^\/\(:]+)}
def initialize