Skip to content

Instantly share code, notes, and snippets.

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

Jarid Wade ihavenoidea14

🏠
Working from home
View GitHub Profile
@ihavenoidea14
ihavenoidea14 / post-message-to-teams.js
Created April 12, 2021 19:33 — forked from johnsibly/post-message-to-teams.js
Javascript for posting a message to a Microsoft Teams channel
'use strict';
const axios = require('axios'); // axios must be installed via npm i axios
const webhookURL = "https://outlook.office.com/webhook/1234567890"; // Replace with a valid webhool URL obtained by adding an "Incomming Webhook" connector to your teams channel
if (process.argv.length === 4) {
const title = process.argv[2];
const message = process.argv[3];
console.log(`${title}, ${message}`);
postMessageToTeams(title, message);
} else {
@ihavenoidea14
ihavenoidea14 / QueryDotnet.js
Created November 2, 2020 14:02 — forked from kphillisjr/QueryDotnet.js
JSCript.NET Working Examples
/*
To Compile:
PATH\\TO\\jsc.exe QueryDotnet.js
This example is based on:
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
*/
import System;
import Microsoft.Win32;
@ihavenoidea14
ihavenoidea14 / JS-LINQ.js
Created August 29, 2020 15:07 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
begin transaction
begin try
update CCDLine
set FlatFee = 61.50
where HUDLineNo = 804 and
FlatFee = 52.75;
rollback;
end try
begin catch
begin transaction;
begin try
update HMDA
set ActionDate = fundedDate.Value
from HMDA h
left join ExtendedDateValue fundedDate
on (h.FileDataID = fundedDate.FileDataID and fundedDate.Name = 'Status_Finance_Funded_Date')
where fundedDate.Value between '01/01/2018' and '12/31/2018'
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
List<Schema.DescribeSObjectResult> standardObjDescs = new List<Schema.DescribeSObjectResult>();
for (Schema.SObjectType sobj : gd.values()) {
Schema.DescribeSObjectResult sobjDesc = sobj.getDescribe();
if (!sobjDesc.isCustom()) {
standardObjDescs.add(sobjDesc);
}
}
List<String> triggerableList = new List<String>();
@ihavenoidea14
ihavenoidea14 / curl.md
Created May 19, 2018 22:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ihavenoidea14
ihavenoidea14 / s-policy-base.json
Created May 16, 2018 21:32
serverless.js Deployment IAM policies
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "NonDestructiveCoreReaderActionsUsedThroughoutServerless",
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
select
d.application_id,
d.first_name,
d.last_name,
concat(d.first_name, ' ', d.last_name) as full_name,
count(*)
from dump_candidates d
group by full_name, d.application_id, d.last_name, d.first_name
having count(*) > 1
order by full_name asc;
@ihavenoidea14
ihavenoidea14 / index.js
Created August 1, 2017 20:41
Using Sequelize with Webpack can be interesting. This snippet should help...
import Sequelize from 'sequelize';
import config from '../config';
// Face, meet desk. Sequelize models and Webpack do not play nicely
let models = {};
(function(config) {
if (Object.keys(models).length && !force) {
return models;
}