Skip to content

Instantly share code, notes, and snippets.

View bad6e's full-sized avatar
💭
Founder of TrekWeather.com

Bret Doucette bad6e

💭
Founder of TrekWeather.com
View GitHub Profile
@bad6e
bad6e / basic-form-refactored.js
Last active February 20, 2018 15:35
Basic-Form-Refactored
import React from 'react'
class BasicFormRefactored extends React.Component {
constructor(props) {
super(props)
this.state = {
firstName: '',
age: '',
}
@bad6e
bad6e / basic-form.js
Last active February 20, 2018 15:33
Basic Form
import React from 'react'
class BasicForm extends React.Component {
constructor(props) {
super(props)
this.state = {
firstName: '',
age: '',
}
onChange = (event) => {
const { target: { name, value } } = event
this.setState({ [name]: value, event: event })
}
import React from 'react'
import CheckboxButtonGroup, { CheckboxButton } from 'components/utils/CheckboxButtonGroup'
class DemoCheckboxButtonGroup extends React.Component {
constructor(props) {
super(props)
this.state = { checkboxDemo: ['red'], event: {} }
}
onChange = (event) => {
@bad6e
bad6e / stuff.js
Created January 26, 2018 14:31
stuff
handleBorrowerToggle = (event) => {
const { target: { name, value } } = event
this.setState({ [name]: value, event })
}
@bad6e
bad6e / gist:ded96be25de70227d657e8ec41017213
Last active January 23, 2018 23:44
Set All Lender's TeamRole default to True
lender = Lender.find :id
team_roles = TeamRole.where(roleable_id: lender.id)
for role in team_roles
role.update(default: true)
end
@bad6e
bad6e / gist:836f896ab2568158f992127136042430
Last active January 23, 2018 23:49
Turn on Defaults Set for All Active Teams for an Organization
org = Organization.find :id
active_teams = org.teams.active
for team in active_teams
team.update(defaults_set: true)
end
@bad6e
bad6e / update.rb
Created December 20, 2017 17:15
iServe Update Notifications
org = Organization.find(575)
teams = org.teams
teams.each do |team|
team.update(status_change_notifications: false)
end
@bad6e
bad6e / react-notes.md
Last active December 16, 2015 17:58 — forked from biglovisa/react-notes.md
React in theory
function countDown(number){
if (number >= 0){
console.log(number);
number = number - 1;
countDown(number);
}
}
countDown(5);