Skip to content

Instantly share code, notes, and snippets.

View MasterKale's full-sized avatar

Matthew Miller MasterKale

View GitHub Profile
@pfrazee
pfrazee / videos.js
Created May 27, 2021 01:28
Script for encoding & compressing MP4s in the browser
import bytes from '../../vendor/bytes/index.js'
const MAX_WIDTH = 600
const MAX_HEIGHT = 600
const { createFFmpeg, fetchFile } = FFmpeg
let ffmpeg
export async function compressAndGetThumb (file, maxVideoSize, progressCb) {
const objectUrl = URL.createObjectURL(file)
const videoEl = document.createElement('video')
videoEl.addEventListener('error', console.log)
@lucianoratamero
lucianoratamero / README.md
Last active April 29, 2024 07:08
Using Vite with Django, the simple way

Using Vite with Django, the simple way

Warning

I'm surely not maintaining this as well as I could. There are also other possible, better integrated solutions, like django-vite, so keep in mind this was supposed to be more of a note to myself than anything :]

This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.

Here's a boilerplate that uses this approach: https://github.com/labcodes/django-react-boilerplate

A couple of things to note:

@Justintime50
Justintime50 / reset-xcode-install.md
Last active February 14, 2024 17:17
Reset Your Xcode Installation on macOS

Reset your Xcode Install on macOS

Having troubles with Xcode or their Command Line Tools? Follow this guide to reset your Xcode instance on macOS and resolve issues such as "No Xcode or CLT version detected!"

1) Check if Xcode is installed

xcode-select -print-path
@pedrouid
pedrouid / webcrypto-examples.md
Created December 15, 2018 01:07
Web Cryptography API Examples
[["AMD", "AMD", "414d4400"],
["Atmel", "ATML", "41544d4c"],
["Broadcom", "BRCM", "4252434d"],
["IBM", "IBM", "49424d00"],
["Infineon", "IFX", "49465800"],
["Intel", "INTC", "494E5443"],
["Lenovo", "LEN", "4C454e00"],
["National Semiconductor","NSM", "4E534D20"],
["Nationz", "NTZ", "4E545A00"],
["Nuvoton Technology", "NTC", "4E544300"],
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 2, 2024 09:06
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@homj
homj / DrawerIconDrawable.java
Last active April 6, 2017 10:11
This Drawable implements the "Drawer-Indicator to Arrow"-Animation as seen in several Material-Design-Apps; NOTE: Mind the updated constructors in Revision 5!
/*
* Copyright 2014 Johannes Homeier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@matthewlehner
matthewlehner / autopgsqlbackup
Created July 11, 2012 16:10
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9