Skip to content

Instantly share code, notes, and snippets.

View danielweinmann's full-sized avatar

Daniel Weinmann danielweinmann

View GitHub Profile
@danielweinmann
danielweinmann / git cleanb
Last active June 1, 2022 03:12
Add an alias to remove all topic branches that are already merged into master
git config --global alias.cleanb "! git checkout main && git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d"
@danielweinmann
danielweinmann / .codeclimate.yml
Created April 13, 2018 14:00
.codeclimate.yml for React projects
version: "2"
plugins:
duplication:
enabled: true
config:
languages:
javascript:
mass_threshold: 50
eslint:
enabled: true
@danielweinmann
danielweinmann / .codeclimate.yml
Created April 13, 2018 13:59
.codeclimate.yml for Ruby + React projects
version: "2"
plugins:
brakeman:
enabled: true
bundler-audit:
enabled: true
duplication:
enabled: true
config:
languages:
{
"minimum_frequency": 261.63,
"notes": [
{
"start": 0.0464399092971,
"name": "C4",
"frequency": 261.63,
"relative_frequency": 0,
"pitches": [
{
@danielweinmann
danielweinmann / index.ios.js
Created February 8, 2016 19:33
Router not passing props to Routes on consecutive renders
import React, { AppRegistry, Component, View, Text } from 'react-native'
import { Provider, connect } from 'react-redux'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import thunkMiddleware from 'redux-thunk'
import createLogger from 'redux-logger'
import { Router, Route } from 'react-native-router-flux'
// ACTIONS
const fetchTodos = () => {
@danielweinmann
danielweinmann / index.ios.js
Created February 4, 2016 06:09
Now it works!
import React, { AppRegistry, Component, Navigator, View, Text, TouchableHighlight } from 'react-native'
import { Router, Route, Actions } from 'react-native-router-flux'
class First extends Component {
render() {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>This is shown when not signed in</Text>
<TouchableHighlight onPress={Actions.second}>
<Text>Next</Text>
@danielweinmann
danielweinmann / index.ios.js
Last active February 19, 2016 07:02
"Cannot read property 'push' of undefined"
import React, { AppRegistry, Component, Navigator, View, Text, TouchableHighlight } from 'react-native'
import { Router, Route, Actions } from 'react-native-router-flux'
class First extends Component {
render() {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>This is shown when not signed in</Text>
<TouchableHighlight onPress={Actions.second}>
<Text>Next</Text>
@danielweinmann
danielweinmann / npm-debug.log
Created January 14, 2016 16:07
npm-debug.log for react-native init AwesomeProject --verbose
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/5.4.1/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '--verbose',
1 verbose cli '--save',
1 verbose cli 'react-native' ]
2 info using [email protected]
3 info using [email protected]
4 verbose install initial load of /Users/danielweinmann/projects/AwesomeProject/package.json
@danielweinmann
danielweinmann / projects_controller.rb
Created August 2, 2011 12:12
Using MoIP integration
def pay
backer = Backer.find params[:backer_id]
current_user.update_attributes params[:user]
current_user.reload
payer = {
:nome => current_user.full_name,
:email => current_user.email,
:logradouro => current_user.address_street,
:numero => current_user.address_number,
:complemento => current_user.address_complement,
@danielweinmann
danielweinmann / teste_merge.rb
Created June 20, 2011 04:07
Testing Git merges using Grit
require 'grit'
require 'fileutils'
# Define our paths.
# We're gonna have 3 paths: one original, one for the fork, and yet another one for the merge
root_path = "#{File.dirname(__FILE__)}/documents"
original_path = "#{root_path}/original_repo.git"
fork_path = "#{root_path}/fork_repo.git"
merge_path = "#{root_path}/merge_repo"