Skip to content

Instantly share code, notes, and snippets.

View gbozee's full-sized avatar
🎯
Focusing

Abiola gbozee

🎯
Focusing
View GitHub Profile
@gbozee
gbozee / stackoverflow.py
Created May 2, 2018 08:42
Sample Question
@app.route('/aggregated-measurements')
def get_aggregated_measurements():
aggregated_measurements_objects = AggregatedMeasurement.query.first()
# this is where the breakpoint would be
import pdb; pdb.set_trace()
# transforming into JSON-serializable objects
aggregated_measurement_schema = AggregatedMeasurementSchema()
result = aggregated_measurement_schema.dump(aggregated_measurements_objects)
return jsonify(result.data)
const steps = [
{
text: "Step 1: Personal Details",
display: true,
url: "personal-info",
completed: false
},
{
display: true,
text: "Step 2: Credentials & Education",
test("When there are two different keys and one needs updating", () => {
const page = [
{
Awards: {
awards: {
heading: "Awards & Certifications",
body: [
{
title: "Shell Ecomarathon Award",
company: "University of Lagos",
@gbozee
gbozee / scenario1.js
Last active February 22, 2018 20:06
Buggy Case
import React from "react";
import { render } from "react-dom";
import Hello from "./Hello";
const styles = {
fontFamily: "sans-serif",
textAlign: "center"
};
class ChildComponent extends React.Component {
High High on eagle's wings 3x
Lord take me higher on eagle's wings
We are going higher
We are moving upward way
Backward never forward ever
We are moving high
Verse 1
@gbozee
gbozee / currency_converter.py
Created January 20, 2018 15:02
Python Meetup Lesson Gist
#Twitter @Beee_sama
#Slack pythonnigeria.slack.com @B33s@m@
rates = [{
'country': ['USA'],
'currency': 'USD',
'rate': 360
},
{
'country': ['UK'],
@gbozee
gbozee / base.html
Created December 29, 2017 19:35
Django app that makes api call to the graphql service
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
@gbozee
gbozee / app.js
Created December 29, 2017 19:20
Server side implementation files with graphql support
// To use preact, we would have
/***
import { getComponent, cdn, afterScripts } from "./preact-server"; // should be the first line because of how module-alias works
***/
import { getComponent, cdn, afterScripts } from "./react-server";
const { graphqlExpress, graphiqlExpress } = require("apollo-server-express");
import Loadable from "react-loadable";
import express from "express";
import path from "path";
$ yarn build # Builds the frontend application

$ yarn build:server # Build the server application

$ yarn server # Starts the server application
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const srcPath = path.resolve(__dirname, 'src'); //same directory that consist of all the source code. the server app resides here
const distPath = path.resolve(__dirname, 'build'); //same directory created by cra after building the frontend app
module.exports = {
context: srcPath,
entry: 'server.js', //name of server file.
output: {
path: distPath,