Skip to content

Instantly share code, notes, and snippets.

## Using the `loop` method
It's your first year at Hogwarts and you're having a tough time getting the hang of that levitation spell. Fill out the content of the method `looping` puts the
levitation charm "Wingardium Leviosa" 10 times using the `loop` keyword.
```ruby
def looping
#your code here
end
# Enumerator Coding Challenge
## Ojbectives
Become familiar using common iterators introduced in the previous lesson.
%%%
### Code Challenge I: Using `.each`
Topic: Object Oriented Ruby
Unit: Beginning OO
Lessons:
1. Readme - intro to OO (missing, needs to be written)
2. structured learning readme
3. using bundler readme
4. Variable Types Readme - improve
5. Object attributes tutorial -- re-brand as a code along and improve
6. Lab: barking dog - update readme
7. Lab: counting sentences - update readme
1. Introduction to SQL: What is it? Why do we need to know about it? Basic set-up/installation
2. First Lab on SQL: Create, insert into, edit and drop tables
* We have a lab that would be good for this: SQL-book-tables. But this lab needs work and also
has them coding sql in the terminal. Do we want this or just jump right into using text editor?
I think good to start in terminal and then next lab has them in text editor and explains how we
are connecting to the databse.
* This lab is way to long and wordy. Needs better organization, fewer types of examples.
3. Follow up with quiz (missing)
4. Creating tables lab - needs readme improvements (objectives are wonky, instructions are lacking, more clarity on
how writing sql statements in Ruby project + running those files = executing the sql statements and creating/alterting a DB)
analysis = Rubycritic::CommandFactory.create(paths: ['.']).critique
modules = analysis.map {|mod| mod}
projects = modules.map do |mod|
{name: mod.name, path: mod.path, rating: mod.rating, smells: mod.smells,
complexity: mod.complexity, church: mod.churn, duplication: mod.duplication,
thod_count: mod.method_count}
end
mod.rating
@SophieDeBenedetto
SophieDeBenedetto / square + container
Created October 24, 2016 21:49
redux chess components
// square container
import React from 'react'
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as actions from '..path to your actions/index.js'
class SquareContainer extends React.Component {
triggerClickActions(e) {
e.preventDefault();
# application controller
class ApplicationController < ActionController::API
before_action :authenticate
def logged_in?
!!current_user
end
def current_user
if auth_present?
@SophieDeBenedetto
SophieDeBenedetto / phoenix_channels_presence_outline.md
Last active July 9, 2018 18:59
phoenix channels + presence outline

Building Real-Time Features with Phoenix Channels and Presence

In this post we'll take a deep dive into Phoenix Channels by building a real-time collaborative text-editing feature. Then, we'll use the Phoenix Presence module to track user activity within that feature.

The App

We're building out a Phoenix app that allows users to collaborate on coding challenges. Users can visit "challenge rooms" and see a code challenge prompt along with an in-browser code editor. Users can collaborate on the code challenge by typing into the text editor.

Here's where our real-time feature comes in. All of the users in the challenge room should be able to see what a given user is typing as they are typing it. We'll leverage Phoenix Channels to support this functionality.

However, not only should they see what a user is typing, they should see an indication of who is typing it. This is where our need to track user state comes in. We'll use Phoenix Presence to build out this behavior.

@SophieDeBenedetto
SophieDeBenedetto / article_ideas.md
Created July 16, 2018 17:59
Ideas for posts for Break In

Brainstorm

Learning for Students

  • How to Learn - Sophie
  • How to ask questions (and why you should!) - Sophie
  • How to Pair Program For Students - Antoin?
  • Should You Attend Meetups?
  • Why, Where and How to Give a Tech Talk
  • There's So Much to Learn! Where Do I Start?? A Guide to Finding the Right Educational Fit At Various Stages - Sophie
defmodule MyApp.ReleaseTasks do
def migrate do
{:ok, _} = Application.ensure_all_started(:my_app)
path = Application.app_dir(:my_app, "priv/repo/migrations")
Ecto.Migrator.run(MyApp.Repo, path, :up, all: true)
end
end