Skip to content

Instantly share code, notes, and snippets.

View oney's full-sized avatar

Wan-Huang Yang oney

View GitHub Profile
@jymcheong
jymcheong / Program.cs
Created February 27, 2019 09:07
WebSocket4Net example
using System;
using WebSocket4Net;
namespace websocket
{
class Program
{
static void Main(string[] args)
{
using (var ws = new WebSocket("ws://1.2.3.4:8080/"))
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@sirosen
sirosen / sign.py
Last active January 25, 2024 20:46
Sign and Verify Using RSA via cryptography (python)
"""
RSA Sign a Message using a private key
Just turns this example into a script:
https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#signing
"""
import sys
import hashlib
import base64
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active May 21, 2024 12:06
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@emrahgunduz
emrahgunduz / WebImageDownloader.cpp
Last active January 25, 2023 21:15
Web Image Downloader For Unreal Engine 4 -- Do not forget to change the include and API key in your own classs, if you simply copy-pasting this.
// (c) 2016 Markakod
#include "HitMe.h"
#include "WebImageDownloader.h"
UWebImageDownloader* UWebImageDownloader::GetWebImageDownloader(FString WebImageName, FString URL, bool& IsValid)
{
IsValid = false;
UWebImageDownloader *Object = NewObject<UWebImageDownloader>();
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@fortunto2
fortunto2 / setup.md
Last active September 21, 2020 07:29
Setup Amazon AWS EC2 g2.2xlarge instance with OpenCV 3.1, Cuda 7.5, ffmpeg, OpenFace
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 23, 2024 06:59
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@iPotaje
iPotaje / example.js
Created April 19, 2016 13:19
Example of Sequelize with sql.js
var lib = require('./patch.js');
var Sequelize = require('sequelize');
var sequelize = new Sequelize('sqlite://dbname', {dialectModulePath: 'sql.js'});
var User = sequelize.define('user', {
username: Sequelize.STRING,
birthday: Sequelize.DATE
});