Skip to content

Instantly share code, notes, and snippets.

View landonconover's full-sized avatar

Landon Conover landonconover

View GitHub Profile
@landonconover
landonconover / post-message-to-teams.js
Created May 23, 2022 17:45 — 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 {
if(orderTotal(
{
items:[
{name: 'cat food', price: 10, quanity: 2},
{name: 'cat bed', price: 20, quanity: 2},
{name: 'shipping', price: 40, shipping: true}
]
}
) !==100){
throw new Error('quanity Path Fail')
import _ from 'lodash'
let hasBreed =
_.curry((breed, obj) => obj.breed === breed)
let dog = (name, size, bread) =>
`${name} is a ${size} dog that is a ${bread}`
dog = _.curry(dog)
//a function to get the full pokemon from the pokemon api.
async function getAllPokemon() {
//get the list of pokemon with the urls.
let response = await fetch('https://pokeapi.co/api/v2/pokemon/');
let pokemon = await response.json()
//make a fetch call for each pokemon
let pokePromises = pokemon.results.map(async(poke) => {
let response = await fetch(poke.url);
function countDownloop(num) {
while(num >= 0) {
console.log(num)
num--
}
}
countDownloop(4)
function countDown( num ) {
@landonconover
landonconover / compRecursion.js
Created September 9, 2020 02:02
Company Recursion
let company = {
sales: [{
name: 'John',
salary: 1000
}, {
name: 'Alice',
salary: 1600
}],
development: {
function get30SWPeople(params) {
let people = [];
const SWPromises = [
fetch('https://swapi.dev/api/people/?page=1'),
fetch('https://swapi.dev/api/people/?page=2'),
fetch('https://swapi.dev/api/people/?page=3')
]
return Promise.all(SWPromises)
.then(ResponsesArr => {
return Promise.all(

##Fixing npm permissions

You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

You can fix this problem using one of three options:

Change the permission to npm's default directory. Change npm's default directory to another directory. Install Node with a package manager that takes care of this for you. You should back-up your computer before moving forward.

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post