Skip to content

Instantly share code, notes, and snippets.

📖

Rodrigo zrod

📖
Block or report user

Report or block zrod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dummy.json
{ "items": [
{
"title": "NASDAQ",
"description": "lorem ipsum etc"
},
{
"title": "WORK",
"description": "Work to live"
},
{
View composer.json
{
"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.*",
View docker-compose.yml
version: '3'
services:
traefik:
image: 'traefik'
restart: 'always'
ports:
- '80:80'
- '8080:8080'
- '443:443'
@zrod
zrod / categories_place.rb
Last active Aug 6, 2018
Saving (associating on new records) many-to-many relationships with Rails / active record
View categories_place.rb
class CategoriesPlace < ApplicationRecord
belongs_to :place
belongs_to :category
validates :place, :category, presence: true
end
@zrod
zrod / categories.js
Last active Jul 21, 2018
property X is read-only in CategoryType [1] but writable in object type [2] in array element.
View categories.js
// @flow
export type CategoryType = {
+id: number,
+name: string,
+slug: string,
+description: string
};
// ...
const categoriesItems = state.categories.items.slice();
View docker-compose.yml
version: '2'
services:
postgres:
image: 'postgres:10.2'
restart: 'always'
ports:
- '5404:5432'
environment:
POSTGRES_USER: 'dev-sql'
View ManageProfile.spec.js
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';
View I18n.js
// @flow
export default class I18n {
translations: {
messages: {},
routes: {}
} = {
messages: {},
routes: {}
};
View App.jsx
// ...
export class App extends React.Component
{
static propTypes = {
auth: PropTypes.object.isRequired
};
render() {
// ...
@zrod
zrod / authReducer.js
Created Dec 2, 2017
spread operator mess
View authReducer.js
import authType from './authType';
import { LIKE_POST_SUCCESS } from '../actions/actionTypes';
export default function authReducer(state = authType, action) {
switch (action.type) {
// ...
case types.LIKE_POST_SUCCESS:
return {
...state,
...{
You can’t perform that action at this time.