Skip to content

Instantly share code, notes, and snippets.

Noel Worden noelworden

Block or report user

Report or block noelworden

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
@noelworden
noelworden / useEffects_Setup.md
Created Jun 10, 2019
converting didmount/update to useEffect
View useEffects_Setup.md
const Messenger: React.FC<Props> = ({
  match,
  hasMessages,
  currentPageNumber,
  webMessages,
  partyUUID,
  actions: {fetchClaimMessages: fetchMessages, resetClaimMessagesPageNumber}
}) => {
  useEffect(
View MoneyLion.md

Starting Local Server

  • mvn -DskipTests install
  • in IntelliJ
    • go to dda-api > src > main > java > com.moneylion.dda.api > DdaApiApplication and right click run
View React_Blog_Post.md

I recently came across a situation where I needed to adjust the styling of a component if another, independent, component was being rendered. Dealing with variables in styled-components is nothing new, but up to this point my I had only implimented variables based on the values of props from the existing component, which can be with a direct assignment:

${props => props.offsetX}px;

Or as part of a conditional:

${props => (props.open ? 'none' : 'translateX(-100%)')};

Both of these examples are pretty straight forward, as long as the props are correctly applied when implimenting the component (or that the proper defaults are assigned) everything will render as expected.

View React_Child_Selectors.md

Styling CSS based on a component other than the current one.

  • for this case, if PageHeading_Heading is directly above Actions, the style should add more to the top
  • div class="PageHeading__Heading-kQhCRq eXRSLM"
    div class="Actions__ActionWrapper-gbZwyU kBIKPX"
    

Import the component from the file, not just the entire file

View jobTimes.md

Time Left

  • minute_array = Api.Repo.all(from slot in Api.Slots.Slot, join: job in assoc(slot, :job), left_join: time_entry in assoc(slot, :time_entry), where: is_nil(time_entry.slot_id) and job.id == 10, select: slot.duration_in_minutes)

  • Enum.sum(minute_array) / 60

Total Time

  • Api.Repo.all(from slot in Api.Slots.Slot, join: job in assoc(slot, :job), left_join: time_entry in assoc(slot, :time_entry), where: time_entry.status == 1 and job.id == 10, select: %{start: time_entry.start_datetime, end: time_entry.end_datetime, break: time_entry.break_in_minutes})
View Email_Downcase_Rabbit_Hole.md
query = """
  SELECT id, inserted_at
  FROM users
  WHERE first_name = $1
"""

query_1 = """
  SELECT id
  FROM users
View Elixiring.md

Ecto

Spin up console

  • docker-compose run api "iex -S mix"

Necessary to point in right direction

  • alias Api.Repo

Example "all" search

  • Repo.all(Api.Users.User)
View Roster_Stuff.md

Storybook Importing

  • import { storiesOf, action, linkTo } from '@storybook/react';
View JavaScripting.md
  • bin/yarn lint:js --fix
  • bin/yarn lint:css
  • docker-compose run web bin/ci
  • bin/yarn add
View Breakpoint_Setup.md

mixins.scss

  $breakpoints: (
  'xs' : ( min-width:  $break-xs  ),
  'sm' : ( min-width:  $break-sm  ),
  'md' : ( min-width:  $break-md  ),
  'lg' : ( min-width:  $break-lg  ),
  'xl' : ( min-width:  $break-xl  ),
  'xxl': ( min-width:  $break-xxl )
You can’t perform that action at this time.