Skip to content

Instantly share code, notes, and snippets.

// coisas que a gente pode fazer com listas
// verificar a lista tem algum elemento
// filtrar elementos da lista
// transformar a lista em outra lista
// verificar a lista tem algum elemento
function elementoNaLista(lista, elemento) {
var resultado = false
def update_associated_rubrics
updateable_rubrics.in_batches(of: 100).each do |relation|
relation.transaction do
relation.lock.each do |rubric|
rubric.update_learning_outcome_criteria(self)
end
end
end
end
import memoize from "memoize-one"
const PostList = ({posts}) => (
posts.map(post => <Post post={post} />)
)
class PostPage extends Component {
state = {
posts: [],
const PostList = ({posts}) => (
posts.map(post => <Post post={post} />)
)
class PostPage extends Component {
state = {
posts: [],
category: ""
}
const PostList = ({posts}) => (
posts.map(post => <Post post={post} />)
)
class PostPage extends Component {
state = {
posts: []
}
const PostList = ({posts}) => (
posts.map(post => <Post post={post} />)
)
class App extends Component {
state = {
posts: []
}
https://facebook.com/2073926166193100_2074950342757349
https://facebook.com/2224043794281497_2235248816494328
https://facebook.com/2231575163528360_2235237209828822
https://facebook.com/2073926166193100_2074924342759949
https://facebook.com/2231575163528360_2235068933178983
https://facebook.com/2073926166193100_2074835072768876
https://facebook.com/2073926166193100_2074808349438215
https://facebook.com/2224043794281497_2234994336519776
https://facebook.com/2213295828689627_2234986709853872
https://facebook.com/2045523635466848_2234923413193535
// Loading provider
const LoadingContext = React.createContext({
pushLoading: () => {},
removeLoading: () => {},
})
class LoadingProvider extends Component {
state = {
loadingCount: 0
# Controller
SendEmailToUser.perform_async user.id
# ...
class SendEmailToUser
include Sidekiq::Worker
sidekiq_options :queue => :default, :retry => true, :backtrace => true
import React from 'react';
import ReactDOM from 'react-dom';
import {Editor, EditorState} from 'draft-js';
class App extends React.Component {
state = {
editorState: EditorState.createEmpty()
}
onChange = editorState => this.setState({editorState})