Skip to content

Instantly share code, notes, and snippets.

//This is my json array
const myArray = [data1, data2, data3, data4, data5];
console.log("seraphine testing ", [myArray[0] + 1]);
class App extends Component {
constructor() {
super();
this.state = {
articleIndex: 0
class App extends Component {
componentDidMount() {
Promise.all([fetch('URL_1_HERE'), fetch('URL_2_HERE')])
.then((articles) => {
this.setState({
articles: articles
})
})
}
import React, { Component } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import "./ranking.css";
class Ranking extends Component {
//
render() {
console.log(this.props.articles);
import React, { Component } from 'react'
import Search from './Search.js'
import SearchResults from './SearchResults.js'
import NewBooking from './NewBooking.js'
export default class Bookings extends Component {
constructor (props) {
super(props)
this.state = {
searchVal: '',
# Make sure you've got the latest as-coffee-base and master branches
$ git fetch
# Get set up with the branch you want to decaffeinate
$ git checkout <MY-BRANCH>
# Rebase it, so it's branched from the changes just before decaffeinating
$ git rebase origin/as-coffee-base
# Run the decaffeination on your branch. You need to be on a version of npm with `npx` available, which I think is default from at least Node 8 onwards. I did this on node 8.4.0 installed via nvm. I think you also need prettier installed in advance.
$ npm install -g prettier prettier-eslint
# The script also requires `zsh` to run, which can be installed via brew or apt.
$ ./decaffeinate.sh
@40thieves
40thieves / gist:0177786f00e9dd92d23ff4c970620253
Created June 18, 2019 16:24
Promisified variadic function
> function foo(arg1, arg2, arg3) {
if (arguments.length === 2) {
arg3 = arg2
}
console.log('arg1', arg1)
console.log('arg2', arg2)
console.log('arg3', arg3)
}
undefined
> foo(1, 2, 3)
"use strict";
module.exports = {
extends: [
"eslint:recommended",
"prettier"
],
rules: {
"arrow-parens": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
@40thieves
40thieves / with-util.js
Created July 3, 2019 09:40
Comparing webpack polyfilling
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;

Effective Learning Strategies

Here are some strategies for learning that scientists and psychologists have found to be effective.

Active Learning vs Passive Learning

Try to do more active learning than passive learning as it is more effective.

Passive Active