Skip to content

Instantly share code, notes, and snippets.

View zrod's full-sized avatar
💻
Refactoring https://donating.io

Rodrigo zrod

💻
Refactoring https://donating.io
View GitHub Profile
@zrod
zrod / Dockerfile
Last active May 11, 2022 03:16
Optimized dockerfile for Rails
# Main stage responsible for installing and configuring Rails and assets dependencies
FROM ruby:3.0.4-alpine AS ruby-base
ARG RAILS_MASTER_KEY
ARG BUNDLER_VERSION=2.3.12
ENV RAILS_MASTER_KEY=${RAILS_MASTER_KEY}
ENV RAILS_ENV=production
ENV NODE_ENV=production
@zrod
zrod / Dockerfile
Created April 26, 2022 03:42
Ansible - docker container as sandbox
FROM ubuntu:20.04
RUN apt update \
&& apt -y upgrade \
&& apt install -y openssh-server vim
RUN useradd -rm -d /home/zrod -s /bin/bash -g root -G sudo -u 1000 zrod \
&& echo 'zrod:mysafepassword' | chpasswd \
&& usermod -aG sudo zrod
{ "items": [
{
"title": "NASDAQ",
"description": "lorem ipsum etc"
},
{
"title": "WORK",
"description": "Work to live"
},
{
{
"name": "akaunting/akaunting",
"description": "Free accounting software, based on Laravel framework.",
"homepage": "https://akaunting.com",
"keywords": ["laravel", "accounting", "software", "online"],
"license": "GPL-3.0+",
"type": "project",
"require": {
"php": ">=5.6.4",
"akaunting/language": "1.0.*",
version: '3'
services:
traefik:
image: 'traefik'
restart: 'always'
ports:
- '80:80'
- '8080:8080'
- '443:443'
@zrod
zrod / categories_place.rb
Last active August 6, 2018 18:56
Saving (associating on new records) many-to-many relationships with Rails / active record
class CategoriesPlace < ApplicationRecord
belongs_to :place
belongs_to :category
validates :place, :category, presence: true
end
@zrod
zrod / categories.js
Last active July 21, 2018 02:37
property X is read-only in CategoryType [1] but writable in object type [2] in array element.
// @flow
export type CategoryType = {
+id: number,
+name: string,
+slug: string,
+description: string
};
// ...
const categoriesItems = state.categories.items.slice();
version: '2'
services:
postgres:
image: 'postgres:10.2'
restart: 'always'
ports:
- '5404:5432'
environment:
POSTGRES_USER: 'dev-sql'
import React from 'react';
import expect from 'expect';
import { shallow, configure } from 'enzyme';
import { createStore } from 'redux';
import moment from 'moment';
import { NewProfilePage } from '../../../src/components/user/NewProfilePage';
import ManageProfile from '../../../src/components/user/ManageProfile';
import defaultState from '../../../src/components/user/defaultState';
import rootReducer from '../../../src/reducers';
import initialState from '../../../src/reducers/initialState';
// @flow
export default class I18n {
translations: {
messages: {},
routes: {}
} = {
messages: {},
routes: {}
};