This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" TODO: | |
" 1. Follow instructions on https://github.com/junegunn/vim-plug. | |
" 2. Copy this file into your ~/.vimrc | |
" 3. Write the file | |
" 4. Run Command :PlugInstall | |
" 5. write & quit | |
" 6. To see the theme correctly you may need to adjust the terminal colours | |
" | |
" VIMRC BELOW: | |
" When started as "evim", evim.vim will already have done these settings, bail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script tag to include in <head>: | |
<script | |
type="text/javascript" | |
src="//maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_GOES_HERE&language=en&libraries=places" | |
></script> | |
import React, { useState, useEffect } from "react" | |
// Async google places autocomplete function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState, useRef, useCallback } from 'react' | |
// Solutions for the article https://atomizedobjects.com/blog/react/using-componentdidmount-in-react-hooks/ | |
// about using componentDidMount in react hooks | |
export function SolutionsOneToFour() { | |
// Solution 1 | |
useEffect(() => { | |
console.log("Mounted") | |
}, []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uses divide and conquer to find the location of a range of date times within a large array of datetimes. | |
// It then uses this location to match the date on another array of the same order containing more information about the date. | |
/* eslint-disable */ | |
const worker = () => { | |
function divideAndConquer(lookFor, data, len, order) { | |
const half = Math.floor(len - 1 / 2); | |
if (!data[half]) return -1; | |
if (data[half] === lookFor) return half; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import { useState, useEffect } from 'react' | |
// for dynamically importing all flags | |
export async function createFlagStore(ary: { node: { iso_country_code: string } }[] | any): Promise<Map<string, string>> { | |
const promises = ary.map(({ node: { iso_country_code } }) => | |
import(`../static/images/flags/${iso_country_code.toLowerCase()}.png`) | |
.then((item) => ({ | |
iso_country_code, | |
flag: item.default, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { cred } from './cred'; | |
var Horseman = require("node-horseman"); | |
var cheerio = require('cheerio'); | |
var PromisePool = require('es6-promise-pool'); | |
export class Pod { | |
constructor(lessonsObj) { | |
var horseman = new Horseman(); | |
this.horseman = horseman; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.out.println("Hello World"); |