Skip to content

Instantly share code, notes, and snippets.

View alexjyong's full-sized avatar

Alex Yong alexjyong

View GitHub Profile
'use strict';
const puppeteer = require('puppeteer');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
async function main() {
var entries=[];//store all the food pantry data;
//headless so i can see what this badboy is doing
const browser = await puppeteer.launch({
@alexjyong
alexjyong / some perl command
Created March 11, 2022 17:04
perl oneliner to filter CLI output
perl -wnE'say /<add a regex here>/g'
example: docker inspect --format='{{index .RepoDigests 0}}' superCoolTag | perl -wnE'say /sha256.*/g'
this would output only the sha256 of the image.
@alexjyong
alexjyong / catdrawer-youtube-to-gif-README.md
Last active August 30, 2023 13:32 — forked from dannguyen/catdrawer-youtube-to-gif-README.md
Using youtube-dl and gifify from the command-line to make a cat gif
@alexjyong
alexjyong / VLCPlayFromYoutube.txt
Last active April 21, 2022 19:40
VLC play from youtube
alias youtube='vlc -I rc --vout none --quiet'
#example usage
# youtube https://www.youtube.com/watch?v=Rl4RFIPLrew
@alexjyong
alexjyong / slackExample.js
Created December 21, 2022 21:23
nodeJS slack talk example
//this uses node version 16.15.0
import { WebClient } from '@slack/web-api';
// An access token (from your Slack app or custom integration - xoxp, xoxb)
const token = "SuperSecretToken";
const web = new WebClient(token);
// This argument can be a channel ID, a DM ID, a MPDM ID, or a group ID
@alexjyong
alexjyong / pasteEnabler.js
Created January 6, 2023 14:51
Renable paste on web pages that block it
var allowPaste = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('paste', allowPaste, true);
@alexjyong
alexjyong / base64Html.py
Last active April 14, 2023 18:59
Converts an html page with image links to an html page with base64 links in python
import sys
import base64
import requests
from bs4 import BeautifulSoup
def convert_images_to_base64(input_file, output_file):
with open(input_file, 'r', encoding='utf-8') as f:
html_content = f.read()
soup = BeautifulSoup(html_content, 'html.parser')
@alexjyong
alexjyong / base64Html.js
Last active April 13, 2023 12:54
Converts an html page with image links to an html page with base64 links in node.js
const fs = require('fs');
const request = require('request');
const { JSDOM } = require('jsdom');
const $ = require('jquery');
const pretty = require('pretty');
function convertImagesToBase64(inputFile, outputFile) {
fs.readFile(inputFile, 'utf8', (err, htmlContent) => {
if (err) throw err;

How to create a Dynamic Manual Workflow with Github Actions

Overview

GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

Context

With all this feature, it's still missing some feature like making a request before a the workflow is created.

@alexjyong
alexjyong / bot.py
Last active June 16, 2023 20:07
gist for my poll bot. too lazy to make a repo rn
import discord
from discord.ext import commands
# Set up the bot prefix
prefix = "!"
# Create a bot instance with intents
intents = discord.Intents.all()
intents.typing = False # Disable typing event (optional)
intents.presences = False # Disable presence event (optional)