Skip to content

Instantly share code, notes, and snippets.

View marclerodrigues's full-sized avatar

Marcle Rodrigues marclerodrigues

View GitHub Profile
@marclerodrigues
marclerodrigues / webpack.config.js
Last active April 14, 2017 13:47
Webpack Configuration
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');
module.exports = {
entry: {
styles: "./web/static/css/main.scss",
javascript: [
"materialize-loader!./materialize.config.js",
"./web/static/js/app.js"
]
@marclerodrigues
marclerodrigues / webpack.config.js
Created April 14, 2017 14:31
Webpack Configuration with Production configs
'use strict';
var path = require('path');
var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin');
// must match config.webpack.dev_server.port
var devServerPort = 3808;
// set TARGET=production on the environment to add asset fingerprints
@marclerodrigues
marclerodrigues / Dockerfile
Created July 14, 2017 21:08
docker-compose.yml
from ruby:2.1.5
env DEBIAN_FRONTEND=noninteractive \
NODE_VERSION=6.9.1
run sed -i '/deb-src/d' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y build-essential libpq-dev postgresql-client
run curl -sSL "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" | tar xfJ - -C /usr/local --strip-components=1 && \
@marclerodrigues
marclerodrigues / inventory.rb
Last active December 7, 2017 00:13
Snippet for performing trades
class TradeValidator
def initialize(params)
@first_inventory = params[:first_inventory]
@second_inventory = params[:second_inventory]
end
def perform
some_criteria ? true : false
end
040921859055c6e3226f78f3e8146beba54163e10996123eebba6a0fa56eaad990fce381a3bed2a088f81a008c840576b53ef85a567383291af30997397913f38b;samflores
class User < ApplicationRecord
validates :terms_of_use, acceptance: true
end
// Uma coisa que eu não entendi é pq você fica passando essa referencia de controle em todo lugar.
// Serve pra que?
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
ScrollView,
TouchableOpacity,
[:key,
[:ids,
[:xor,
[[:and, [[:predicate, [:array?, [[:input, ["asdf"]]]]], [:each, [:predicate, [:int?, [[:input, ["asdf"]]]]]]]], [:predicate, [:eql?, [[:left, [""]], [:right, ["asdf"]]]]]]]]]
@marclerodrigues
marclerodrigues / my_spec.rb
Created August 24, 2019 02:42
and_call_original_example
class Service
def call
request = Request.call
request.body
end
end
class Request
def call; end
@marclerodrigues
marclerodrigues / replase.sh
Created October 8, 2019 03:43
replace string in all files with sed
sed -i 's/foo/bar/g' files_directory/*