Skip to content

Instantly share code, notes, and snippets.

View joe-oli's full-sized avatar
💭
what the flock? no status to report, i am not a facebook junkie.

joe-oli

💭
what the flock? no status to report, i am not a facebook junkie.
View GitHub Profile
@joe-oli
joe-oli / Memory.cs
Created November 18, 2019 05:11
read and write to memory
// <copyright file="Memory.cs" company="SchuCreations">
// Copyright (c) 2009-2010 All Right Reserved
// </copyright>
// <author>Justin Schuhmann</author>
// <email>[email protected]</email>
// <date>2010-1-28</date>
// <summary>Used to Read and Write to memory.</summary>
namespace Voodoo
{
@joe-oli
joe-oli / es7-async-await.js
Created November 19, 2019 00:50
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@joe-oli
joe-oli / formatXML.js
Created November 19, 2019 01:39 — forked from sente/formatXML.js
javascript to format/pretty-print XML
The MIT License (MIT)
Copyright (c) 2016 Stuart Powers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@joe-oli
joe-oli / The Technical Interview Cheat Sheet.md
Created November 26, 2019 20:26 — forked from ChadMoran/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@joe-oli
joe-oli / hoisting.js
Created November 26, 2019 20:30 — forked from tsiege/hoisting.js
Hoisting examples
// what's hoisted
// var carName (just the variable name is hoisted)
// driveCar (whole function is hoisted because driveCar is a function declaration)
// var parkCar (just the variable name is hoisted because parkCar is a function expression)
console.log(carName);
// -> undefined
driveCar(carName);
// -> driving undefined
parkCar(carName);
// -> TypeError: undefined is not a function
@joe-oli
joe-oli / Navbar-breakpoint-960px.css
Created November 30, 2019 10:06
Media Query CSS - for Navbar breakpoint at 960px width
@media (max-width: 960px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
@joe-oli
joe-oli / Navbar-breakpoint-1200px.css
Created November 30, 2019 10:08
Media Query CSS - For Navbar breakpoint at 1200px
@media (max-width: 1200px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
//from: https://gist.github.com/heaversm/7334b6386e7060551830b4f3095e9366#file-react_to_google_sheets_form-js
import { Form, Text } from 'informed'; //https://joepuzzo.github.io/informed/
import React from 'react';
const SPREADSHEET_ID = 'nhlD3E6xsi2lbDQ71HTJ3oQ1Ql5dIkuiK4IoZYjHD'; //from the URL of your blank Google Sheet
const CLIENT_ID = '2d280542491u-3aofp4eFeftog7q0u5a73ro566h8vi.apps.googleusercontent.com'; //from https://console.developers.google.com/apis/credentials
const API_KEY = 'AIzaSyCz5fYFuCORKGXSGu4IwKq4U_HfcdDtB'; //https://console.developers.google.com/apis/credentials
const SCOPE = 'https://www.googleapis.com/auth/spreadsheets';
@joe-oli
joe-oli / Js-Notes.js
Last active December 3, 2019 22:02
Random JS notes
//to convert string "true","false" to a boolean
var myBool = (mystring === "true");
//because using
var myBool = eval(myString) // is evil ! bwahahah
//=================
//One of the weird behaviour and spec in Javascript is the typeof Array is Object.
//Server-side
@app.route('/message', methods=['POST'])
def print_post():
if request.headers['Content-Type'] == 'text/plain':
logging.warning(request.data)
return "Text Message: " + request.data
else:
logging.warning('didnt work')
return 'Unsupported Media Type'