Skip to content

Instantly share code, notes, and snippets.

Alasdair Smith 40thieves

Block or report user

Report or block 40thieves

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
View index.js
"use strict";
module.exports = {
extends: [
"eslint:recommended",
"prettier"
],
rules: {
"arrow-parens": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
View gist:0177786f00e9dd92d23ff4c970620253
> 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)
View rebase-post-decaf.sh
# 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
View Bookings.js
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: '',
View snippet2.js
import React, { Component } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import "./ranking.css";
class Ranking extends Component {
//
render() {
console.log(this.props.articles);
View snippet2.js
class App extends Component {
componentDidMount() {
Promise.all([fetch('URL_1_HERE'), fetch('URL_2_HERE')])
.then((articles) => {
this.setState({
articles: articles
})
})
}
View snippet.js
//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
View stack-traces.js
/*
* Example 1
*/
function example1() {
return "Ali".ToUpperCase();
}
console.log(example1());
/*
* Example 2
View cyf-class4-mini-project.md

Create a form that:

  1. Has a dropdown to select an option from a list
  2. An input to type out a short sentence
  3. A longer textbox to write out a paragraph of text
  4. A submit button
  5. Has useful labels for each field
  6. Code that runs when the submit button is clicked
  7. Code to make a POST request containing the form data
  8. Code to check form validation
View Work GPG Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFu7H3gBEADMwsszOxErzCY6ws/ME+dA1bSlpiKCib3/XePhIG9au2+2JrZ+
T6YbwHZvbfVPekDA4hSFxPIIe8Lwp8Wq9ybedKCfq98tdZSG9PpPIKhWcUNY/D9Y
IsblFMHRaZxIRvT1k7g9mS4UOVgWGWHy5x0sgkN7FSvO2B7mlcIboAk9qhuJVBdZ
bFMsGNyB0BTo7fdRztj8/JArtcH8IbR09Py153mvhEQGjv68INcSx6CkA2LBbeTD
RmUP9VGb1nAIO02SX+Hx3HJSrQpECBo09QqnFc6dDOGdY1QX61CeObATT4AuYNXD
PIhtHC4iwKrTA9g22j1588Hr4dEmuhtGtBhvYVE5ufEN/EuHZPRhQ7L41za46HUI
8J+CamEhnMck7qn9SV+1NM9qPs4aI6XnwJ7x+Eod19uRuxbVyPXsdaC5lzMJ2WG7
fxazE4QQ7FYSY1ssjfUw6VGA5lqAjsT/JadI5/uiCpA1HtkvPbRHBzUN1MzXogrg
You can’t perform that action at this time.