Skip to content

Instantly share code, notes, and snippets.

View alucard001's full-sized avatar

Ellery Leung alucard001

View GitHub Profile
@kuharan
kuharan / send_email_with_attachments.py
Created February 14, 2021 05:37
Send email with attachments in AWS lambda
def send_email(sender, recipient, aws_region, subject, file_name):
# The email body for recipients with non-HTML email clients.
BODY_TEXT = "Hello,\r\nPlease find the attached file."
# The HTML body of the email.
BODY_HTML = """\
<html>
<head></head>
<body>
<h1>Hello!</h1>
<p>Please find the attached file.</p>
@imyoungyang
imyoungyang / gist:af705e75aa6319549b41fa638ac5d0f5
Last active August 7, 2020 08:22
hsagemaker-bootcam-materials
## Day 3 Materials
git clone https://github.com/HKT-SSA/bring-your-own-container-on-sm.git
git clone https://github.com/HKT-SSA/yolov5-on-sagemaker.git
powerpoint: https://tinyurl.com/y43bxytx
billing alert: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html
mlops:
https://github.com/imyoungyang/myAWSStudyBlog/tree/master/ml-ops-poc
https://github.com/imyoungyang/iam-nija-workshop
@marlosirapuan
marlosirapuan / gist:778d6beda5f8ab95695748011c864b19
Last active October 27, 2024 16:27
Download .m3u8 files on MacOS

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@taitems
taitems / plate-snitch.js
Created August 20, 2017 03:56
(Extract) Check the status of a vehicle registration and scrape results.
// Open form and submit enquire for `rego`
function getInfo(rego) {
horseman
.userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
.open(url)
.type('#registration-number-ctrl input[type=text]', rego)
.click('.btn-holder input')
.waitForSelector('.ctrl-holder.ctrl-readonly')
.html()
.then(function(body) {
@gokulkrishh
gokulkrishh / media-query.css
Last active November 10, 2024 02:00
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@jamesdixon
jamesdixon / custom-fonts.php
Created March 9, 2015 21:54
Wordpress Allow Custom Font Upload
<?php
// add to your theme's functions.php file
add_filter('upload_mimes', 'add_custom_upload_mimes');
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes['otf'] = 'application/x-font-otf';
$existing_mimes['woff'] = 'application/x-font-woff';
$existing_mimes['ttf'] = 'application/x-font-ttf';
$existing_mimes['svg'] = 'image/svg+xml';
$existing_mimes['eot'] = 'application/vnd.ms-fontobject';
return $existing_mimes;
@qas612820704
qas612820704 / studenpackfree.md
Last active February 28, 2022 15:11
用學生信箱申請github提供的免費資源申請雲端主機(DigitalOcean+namecheap)

用學生信箱申請github提供的免費資源申請雲端主機(DigitalOcean+namecheap)

現在 github 有提出一系列對學生的優惠服務 詳情請點這裡

只要你是學生(擁有內含edu的信箱 ex:[email protected])

如果你是學生又是黑客的話,就讓我們來申請吧!

Part I Get Student pack

@pbojinov
pbojinov / README.md
Last active November 5, 2024 03:29
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe