Skip to content

Instantly share code, notes, and snippets.

View Oluwasetemi's full-sized avatar
🏠
Working from home

Oluwasetemi Ojo Oluwasetemi

🏠
Working from home
View GitHub Profile
@Oluwasetemi
Oluwasetemi / Todo.js
Created February 7, 2018 20:16
A TODO App in react
class TodoApp extends React.Component {
constructor(props) {
super(props);
this.state = { items: [], text: '' };
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
render() {
return (
@Oluwasetemi
Oluwasetemi / markdown.js
Created February 7, 2018 20:17
A MarkdownComponent
class MarkdownEditor extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.state = { value: 'Type some *markdown* here!' };
}
handleChange(e) {
this.setState({ value: e.target.value });
}
@Oluwasetemi
Oluwasetemi / bling.js
Created April 28, 2018 07:20 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@Oluwasetemi
Oluwasetemi / vscode-italics.json
Created May 30, 2018 03:33 — forked from dev01d/vscode-italics.json
VSCode italics in (almost) any theme
// All you need to do is add a font that has pretty good itlaics support i.e Fira, Operator, etc. and then add these two params to your existing User settings.
// Tested in Monokai Sharp and Super One Dark
{
"editor.fontFamily": "'Operator Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
function fizzBuzz(amount) {
// let arr = []
// for (let i = 0; i <= amount; i++) {
// arr.push(i)
// }
return Array.from({ length: amount + 1 })
.map((v, i)=> i)
.filter((v => v !== 0))
.map(v => {
if (v % 3 === 0 && v % 5 === 0) {
#!/usr/bin/env node
console.log('hello from npx')
@Oluwasetemi
Oluwasetemi / pyramid.js
Last active July 30, 2018 21:48
Pascal triangle
const pyramid = n => {
const oddNumberArray = Array.from({ length: n * 2 })
.map((v, i) => i + 1)
.filter(v => {
if (v % 2 !== 0) return v
})
let oddStringArray = numberToString(oddNumberArray)
oddStringArray.map(v => console.log(pad(v, (n * 2) - 1)))
}
@Oluwasetemi
Oluwasetemi / html.md
Last active October 30, 2018 10:12
html

HTML

Table of Content

  1. HTML Introduction
  2. HTML Basics
  3. HTML Attributes
  4. HTML Advanced
  5. HTML Entities
  6. CSS in HTML - Cascading Style Sheets
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
const { GraphQLClient } = require('graphql-request');
const client = new GraphQLClient('https://api.github.com/graphql', {
headers: { Authorization: 'token XXXX' }
});
(async () => {
try {
const query = `
{ viewer { name repositories(isFork: true, first: 10) { edges { node { createdAt name databaseId } cursor } totalCount pageInfo { endCursor startCursor hasNextPage hasPreviousPage } } } }