Skip to content

Instantly share code, notes, and snippets.

View pchinjr's full-sized avatar
🙏
Building the best tools to #praisecage

Paul Chin Jr. pchinjr

🙏
Building the best tools to #praisecage
View GitHub Profile
@pchinjr
pchinjr / SwitchAudio.ps1
Created June 6, 2024 19:01
This script toggles the default audio output device between headphones and speakers on a Windows system.
# SwitchAudio.ps1
# This script toggles the default audio output device between headphones and speakers on a Windows system.
# Documentation:
# This script uses the AudioDeviceCmdlets PowerShell module to manage audio devices.
# It identifies the current default audio device and switches to the other specified device.
# Dependencies: AudioDeviceCmdlets module
# Step-by-step guide to set up and use this script:
void loop() {
int i = 0;
// Put DigDug first frame
for(int passtime = 0; passtime < 50; passtime++) {
FastLED.clear();
for(i; i < NUM_LEDS; i++) {
leds[i] = pgm_read_dword(&(Fire01[i]));
}
FastLED.show();
@pchinjr
pchinjr / index.js
Created August 7, 2020 23:53
Serverless Architect Hello World - illustrates an AWS Lambda Function in Architect for an HTTP GET Request
// /project/path/src/http/get-index/index.js
exports.handler = async function http(request) {
return {
headers: {'content-type': 'text/html; charset=utf-8;'},
body: '<h1>Hello World! 🎉</h1>'
}
}
@pchinjr
pchinjr / index.ts
Created May 26, 2020 04:59
deno 1.0 command line test
//https://www.youtube.com/watch?v=hVqNwrpCtm4
import { parse } from "https://deno.land/std/flags/mod.ts";
import { TextProtoReader } from "https://deno.land/std/textproto/mod.ts";
import { BufReader } from "https://deno.land/std/io/bufio.ts";
const parsedArgs = parse(Deno.args);
async function main() {
if (parsedArgs.h || parsedArgs.help || parsedArgs._.length === 0) {
console.log("try saying 'hi'");
export function quote() {
let quotes = [
"It's a family that's loaded with grudges and passion. We come from a long line of robbers and highwaymen in Italy, you know. Killers, even.",
"To be a good actor you have to be something like a criminal, to be willing to break the rules to strive for something new.",
"I think I jump around more when I'm alone.",
"I bought a Yamaha-1 and I was doing 180 miles per hour home on the 405 and that's really, really crazy but I did it.",
"I believe that being successful means having a balance of success stories across the many areas of your life. You can't truly be considered successful in your business life if your home life is in shambles.",
"I always say to myself that if I can make a movie that makes a kid smile or gives them some hope or something to get excited about, then I'm applying myself in the best way that I can. I don't think that just goes for kids. I think that it goes for adults, as well, and for families.",
"Passion is very impo
// learn more about HTTP functions here: https://arc.codes/primitives/http
exports.handler = async function http (req) {
return {
headers: {'content-type': 'text/html; charset=utf8'},
body: `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
# example .arc file
@app
test-app
@http
get / # home route
get /login # login route
get /logout # logout route
@tables
try {
myLove()
}
catch(feelings) {
console.log('oh no')
}
const RollingSpider = require('rolling-spider');
const rollingSpider = new RollingSpider();
rollingSpider.connect( function() {
rollingSpider.setup( function () {
rollingSpider.flatTrim();
rollingSpider.startPing();
rollingSpider.flatTrim();
console.log('Connected to drone ', rollingSpider.name);
console.log(rollingSpider.status);
//Server Side Code
const io = require('socket.io')(server);
io.on('connection', function(socket) {
console.log('Your socket id is', socket.id);
socket.on('eventName', function doSomething() {
console.log('executing doSomething')
})
});