This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # # Welcome message | |
| puts "Hello! Welcome to TextCalc 0.7" | |
| # Define calculator function | |
| def runcalc | |
| # Ask for operator | |
| puts "Add, subtract, divide, multiply, or grow exponentially?" | |
| opor= gets.chomp | |
| if opor == "add" then | |
| # Adding | |
| puts "1st Number" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # # Welcome message | |
| puts "Hello! Welcome to TextCalc 0.7" | |
| # Define calculator function | |
| def runcalc | |
| # Ask for operator | |
| puts "Add, subtract, divide, multiply, or grow exponentially?" | |
| opor= gets.chomp | |
| if opor == "add" then | |
| # Adding | |
| puts "1st Number" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Welcome | |
| puts "TextCalC Light 0.71, forked from @micahlt" | |
| def runit | |
| puts "Enter expression" | |
| prob = gets | |
| prob = prob.split | |
| if prob[1] == "*" then | |
| puts prob[0].to_i * prob[2].to_i | |
| if gets.chomp == "again" then | |
| runit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Empty file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch('http://example.com/api-endpoint', { | |
| method: 'POST', // this can be GET, POST, PUT, DELETE, etc depending on the API's standards | |
| body: 'hello, api' // this can be any data you choose to transmit through a POST or PUT request | |
| // there are other options as well, check out the MDN article | |
| }) | |
| .then(response => response.json()) // the response object has several properties | |
| // the most commonly used are .json() and .status() | |
| .then(data => { | |
| console.log(data); // now you can do whatever you want with the data, which is the property of the | |
| // response object you passed above. You can also pass the entire response object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("dotenv").config(); | |
| const MongoClient = require("mongodb").MongoClient; | |
| const prompts = require("prompts"); | |
| (async () => { | |
| const client = new MongoClient(process.env.CAFMONGO); | |
| const dbName = "info"; | |
| await client.connect(); | |
| const db = client.db(dbName); | |
| const collection = db.collection("db-meta"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default dynamic(() => Promise.resolve(Page), { | |
| ssr: false, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # MICAH LINDLEY'S POWERSHELL PROFILE | |
| Function up { cd .. } | |
| Function ~ { cd ~ } | |
| Function gocode { cd "C:\Users\Micah Lindley\Documents\Code" } | |
| Function cbt { | |
| start firefox $args | |
| start microsoft-edge:$args | |
| $argList = '{0} --profile-directory="Default"' -f $args | |
| start chrome -ArgumentList $argList | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias up="cd .." | |
| alias nrd="npm run dev -- --port=3000" | |
| alias nrb="npm run build" | |
| alias nr="npm run" | |
| alias cls='clear' | |
| alias cpbranch="git rev-parse --abbrev-ref HEAD" | |
| alias lsports="sudo lsof -i -P -n | grep LISTEN" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const path = require("path"); | |
| const { Readable } = require('stream'); | |
| const { finished } = require('stream/promises'); | |
| const downloadFile = (async (url, path) => { | |
| try { | |
| const stream = fs.createWriteStream(path); | |
| const { body } = await fetch(url); | |
| return await finished(Readable.fromWeb(body).pipe(stream)); |
OlderNewer