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 / IIS-Express-notes.txt
Created November 16, 2020 16:23
IIS Express to serve with machine-name instead of localhost (useful for Fiddler with WCF-services)
For Fiddler to monitor, the minimal you need to do is your client needs to communicate with
http://machine-name:port/TestService.svc
NOT localhost:port NOT 127.0.0.1:port
---
Your WCF-service is running on IIS Express, thru Visual Studio;
See (WCF-)Project / Properties / Web / Servers:IIS Express
Project Url: http://localhost:50122/TestService.svc
@joe-oli
joe-oli / XmlElement-vs-XElement.txt
Created November 15, 2020 15:44
XmlElement to XElement + vice versa
Convert XmlElement to XElement
---
Private Function ConvertToXmlElement(ByVal elem As XElement) _
As XmlElement
Dim xmldoc As New XmlDocument()
xmldoc.Load(elem.CreateReader())
Return xmldoc.DocumentElement
End Function
ffmpeg -f lavfi -i 'testsrc2=size=1280x720:rate=60,format=yuv420p' \
-f lavfi -i 'sine=frequency=440:sample_rate=48000:beep_factor=4' \
-c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \
-b:v 1400k -bufsize 2800k -x264opts keyint=120:min-keyint=120:scenecut=-1 \
-c:a aac -b:a 32k -f flv rtmp://transcoder/encoder/colorbar
@joe-oli
joe-oli / named_colors.js
Created September 4, 2020 16:26
named colors
module.exports.COLORS_MAP = {
"AliceBlue": "#F0F8FF",
"AntiqueWhite": "#FAEBD7",
"Aqua": "#00FFFF",
"Aquamarine": "#7FFFD4",
"Azure": "#F0FFFF",
"Beige": "#F5F5DC",
"Bisque": "#FFE4C4",
"Black": "#000000",
"BlanchedAlmond": "#FFEBCD",
@joe-oli
joe-oli / index.html
Last active September 3, 2020 11:44
minimal html boilerplate / template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My Title</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/icon.png" />
@joe-oli
joe-oli / tsql-xml.sql
Created August 22, 2020 05:01
snippets for tsql that deals with xml
-- T-SQL, XQuery, XML stuff quick ref
declare @xml xml = N'
<root>
<node roll="1" fname="sid">Luke Skywalker</node>
<node roll="2" fname="neel">Anakin Skywalker?<node>
</root>'
-- prints the roll number of the first node
select @xml.value('(/root/node/@roll)[1]', 'INT')
@joe-oli
joe-oli / add_day.js
Last active August 4, 2020 06:21
Add 1 day to date in JS
// Create new Date instance (or use another date, but a JS date object)
var date = new Date();
// add a day
date.setDate(date.getDate() + 1);
//REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
@joe-oli
joe-oli / youtube_comment.txt
Created August 4, 2020 05:03
Youtube comment or link at specific time
Find the time as seen in the video player
(1) To link to another video
Right click: Copy video url at current time
OR
(2) To link to same video (in a comment for the same video):
just enter the timestamp, in the format Hours:Minutes:Seconds (i.e. no spaces)
@joe-oli
joe-oli / isWeekend.js
Last active July 24, 2020 07:18
Weekend in Javascript
function isWeekend(thisDate) {
let tf = Object.prototype.toString.call(thisDate) === '[object Date]'
if (tf)
throw new Exception("input parameter is not a Date)
//.getDay() returns a integer between 0 and 6 (0 being Sunday, 6 being Saturday).
if( thisDate.getDay() == 6 || thisDate.getDay() == 0 )
return true;
else
return false;
@joe-oli
joe-oli / makeHttpReq.js
Created July 23, 2020 05:40
Http-Client using Node.exe only
/*=========================
USAGE: >node makeHttpReq.js
=========================== */
const INTERVAL_MINS = 15;
const http = require('http'); //define the native (to node) http module, where you can make a request;
const url = "http://YOUR/SERVER/HERE/Path/To/Your/Route.aspx";
callbackFN(); //MAKE ONE CALL, then set up periodic calls...
let requestLoop = setInterval( callbackFN, INTERVAL_MINS*60*1000);