Skip to content

Instantly share code, notes, and snippets.

View brunoguerra's full-sized avatar
🌌
Growing online businesses 🥇

Bruno Guerra brunoguerra

🌌
Growing online businesses 🥇
  • Blumenau, SC
View GitHub Profile
@brunoguerra
brunoguerra / build-heroku
Created September 9, 2016 23:24
nodejs build heroku testinho
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=4.2.0
engines.npm (package.json): ^3.0.0
@brunoguerra
brunoguerra / backend.js
Last active September 12, 2016 05:56
Angular 1.5 :~
import angular from 'angular';
// fn
const normaliz = ( entities ) => ( {
entities: entities.reduce( (r, e) => Object.assign( r, { [e._id]: e } ), {} ),
ids: entities.map( d => d._id )
} );
const storeItem = ( item ) => ( value ) =>
@brunoguerra
brunoguerra / firebase.js
Created September 16, 2016 02:01
Learning firebase
import firebase from 'firebase';
firebase.initializeApp({
serviceAccount: `${__dirname}/../../server/config/firebase.json`,
databaseURL: 'https://pontuali-dev.firebaseio.com/',
});
const db = firebase.database();
const dataRef = db.ref('/data');
dataRef.on('child_added', (snapshot) => {
console.log('addedded, child', snapshot.val());
});
import React from 'react'
import FormValidate, { ErrorComponent, identity, ruleValidate, validator } from '../Form_HOC'
import { mount } from 'enzyme'
import { withHandlers } from 'recompose'
import { Stateful } from 'react-mock'
describe('FormValidate', () => {
let Form
let wrapper
let stateful
@brunoguerra
brunoguerra / README.md
Last active March 26, 2021 00:03
GIT FETCH SPECIFIC COMMIT

make a new blank repository in the current directory

git init

add a remote

git remote add origin url://to/source/repository

fetch a commit (or branch or tag) of interest

Note: the full history of this commit will be retrieved

git fetch origin # SHA #

@brunoguerra
brunoguerra / gen.config.js
Last active November 1, 2017 17:49
Declarative Backend
export default {
'users': 'User'
}
@brunoguerra
brunoguerra / GridContainerFactory-test.js
Last active September 22, 2017 16:20
Jest - Testing Redux with Mocking Store and Factory
import React from 'react'
import 'prop-types'
import GridFactory, { GridContainerFactory } from '../GridContainer'
import { mount } from 'enzyme'
const mockRequestAction = { type: 'REQUEST_ACTION_TEST' }
const List = ({ records }) => <ul records={records}></ul>
const props = {
addFormUniqueName: 'form1',
reducerName: 'form-test-x',
@brunoguerra
brunoguerra / app.build.gradle
Created November 1, 2017 17:48
Force android tu build submodules with right buildTools and Sdk versions
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
}
}
}
@brunoguerra
brunoguerra / console-script-twitter-unfollow-script.js
Last active May 2, 2018 18:23
Unfollow people for free on Twitter with Dev tools console
var count = 0;
function autoScrolling() {
var interval = 200;
window.scrollTo(0, document.body.scrollHeight);
$('.ProfileCard-content').each(function() {
var status = $(this)
.find('.FollowStatus')
.text();
var unfollowButton = $(this).find('.user-actions-follow-button');
if (status != 'Follows you') {
@brunoguerra
brunoguerra / docker-compose.yml
Created June 1, 2018 13:24
Mongo replica-set with docker
version: '2'
services:
replica1:
image: mongo:3.0
container_name: mongo1
ports:
- "27017:27017"
volumes:
- ./mongodata/replica1:/data/db
command: mongod --smallfiles --replSet "mrmtx"