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 / Upsert_OneManyExample.cs
Created March 26, 2019 05:00
UPSERT 1-M DATA EXAMPLE - insert or update within a transaction
//UPSERT 1-M DATA EXAMPLE - insert or update within a transaction
//---------------------------------------------------------------
//
private void Upsert_OneManyExample(OneManyDto myDtoObject)
{
/* ASSUME DTO Object has the form:
myDtoObject = {
oneHeader = ... some object here
} manyLines = ... some array of objects here...
*/
@joe-oli
joe-oli / basic-html-page.html
Last active September 3, 2020 11:50
basic / minimal html template / boilerplate
<html>
<head>
<link rel="stylesheet" href="bootstrap.css">
<link rel="stylesheet" href="your-other-styles.css">
</head>
<body>
<!-- content -->
<script src="jquery.js"></script>
<script src="bootstrap.js"></script>
<script src="your-other-scripts.js"></script>
@joe-oli
joe-oli / disable-dir-browse-web.config
Last active August 19, 2019 06:56
disable directory browsing a folder on IIS
//set the Web.config for the site which you want to disable dir-browsing; any child folders within the site are also non-browsable.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<directoryBrowse enable="false"/>
</system.webServer>
</configuration>
//to scope it to a specific folder within the Site or App, use location tag.
@joe-oli
joe-oli / search-recent-browsed-history.txt
Created August 23, 2019 01:51
search recent questions viewed on stackoverflow (or any site really !)
Ctrl/H
Search History (optionally, filter your last browser activity)
No need to Enter, filters on the fly
Works on Chrome and Firefox on Windows; Safari and IE no idea / who cares, but there may be something equivalent.
@joe-oli
joe-oli / react-notes-101.txt
Created September 5, 2019 07:33
random react notes
PropTypes.objectOf is used when describing an object whose properties are all the same type.
const objectOfProp = {
latitude: 37.331706,
longitude: -122.030783
}
// PropTypes.objectOf(PropTypes.number)
PropTypes.shape is used when describing an object whose keys are known ahead of time, and may represent different types.
@joe-oli
joe-oli / IIS-react-Web.config
Created September 16, 2019 02:14
IIS react web.config to redirect a not found 404 route to index.html
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<remove value="default.aspx" />
<remove value="iisstart.htm" />
<remove value="index.htm" />
<remove value="Default.asp" />
<remove value="Default.htm" />
@joe-oli
joe-oli / http-ajax-libs-examples.js
Last active September 18, 2019 01:52
http ajax library examples, e.g. fetch, axios, etc
//=== #1: axios and React.js =================================
import React, { Component } from "react"
import axios from "axios"
export default class extends Component {
componentDidMount() {
axios.get("https://jsonplaceholder.typicode.com/users/1")
.then(response => {
console.log(response.data)
@joe-oli
joe-oli / stack-and-queue-in-javascript.js
Last active September 19, 2019 07:01
javascript stack and queue
//-- stack -----------
let stackArr = [];
stackArr.push(2); // [2]
stackArr.push(5); // [2, 5]
let item = stackArr.pop(); // stackArr is now [2] //
console.log(item); // displays 5
//-- queue -----------
let queueArr = [];
@joe-oli
joe-oli / Sticky-Footer-1.html
Created September 25, 2019 14:10
Sticky Footer 1 (no flexbox)