Skip to content

Instantly share code, notes, and snippets.

View mhulet's full-sized avatar

xMike mhulet

  • Earth
View GitHub Profile
@erdostom
erdostom / Dockerfile
Last active November 25, 2022 14:53
Good starter Dockerfile + docker-compose.yml for Rails 6.
FROM ruby:2.6.5-alpine
RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn
RUN gem install bundler:2.1.4
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --check-files
@pmhoudry
pmhoudry / trixUpload.js
Last active May 7, 2021 16:37
Trix upload button in VanillaJs
(function() {
// Adding upload button to Trix toolbar on initialization
document.addEventListener('trix-initialize', function(e) {
trix = e.target;
toolBar = trix.toolbarElement;
// Creation of the button
button = document.createElement("button");
button.setAttribute("type", "button");
button.setAttribute("class", "attach");
@j15e
j15e / _lang_choice.html.erb
Created September 12, 2012 15:15
Spree language switch
<%
# app/views/spree/shared/_lang_choice.html.erb
# Deface + I18n.with_locale do not play well together, implementing it manually
saved_locale = I18n.locale
I18n.locale = I18n.locale == :fr ? :en : :fr
%>
<li class="lang-swich"><%= lang_switch_url %></li>
<% I18n.locale = saved_locale %>
@davidslvto
davidslvto / README
Created September 12, 2012 10:27
Spree::Pages - With Translations
You need to have the following gems:
- spree_multi_lingual
- spree_pages
( In my case I'm using these ones)
gem 'spree_multi_lingual' , :git => 'git@github.com:davidslvto/spree_multi_lingual.git', :branch => 'new_features'
gem 'spree_pages' , :git => 'git@github.com:davidslvto/spree_pages.git'
After that you probably are ready to translate some pages!