Skip to content

Instantly share code, notes, and snippets.

View Makio64's full-sized avatar

Makio64 Makio64

View GitHub Profile
@cghiban
cghiban / mp4-to-dash.sh
Created October 4, 2021 13:49
mp4-to-dash.sh
#!/bin/bash
# can't remember where I found this..
#
# THIS SCRIPT CONVERTS EVERY MP4 (IN THE CURRENT FOLDER AND SUBFOLDER) TO A MULTI-BITRATE VIDEO IN MP4-DASH
# For each file "videoname.mp4" it creates a folder "dash_videoname" containing a dash manifest file "stream.mpd" and subfolders containing video segments.
# Explanation:
# Validation tool:
@joshbetz
joshbetz / Webview.swift
Created February 12, 2020 15:36
A simple SwiftUI Webview
import SwiftUI
import WebKit
struct ContentView: View {
var body: some View {
Webview(url: URL(string: "https://google.com")!)
}
}
struct Webview: UIViewRepresentable {
@mattdesl
mattdesl / MeshCustomMaterial.js
Last active April 5, 2023 08:41
Custom mesh standard material with glslify + ThreeJS r83dev
const glslify = require('glslify');
const path = require('path');
// This is the original source, we will copy + paste it for our own GLSL
// const vertexShader = THREE.ShaderChunk.meshphysical_vert;
// const fragmentShader = THREE.ShaderChunk.meshphysical_frag;
// Our custom shaders
const fragmentShader = glslify(path.resolve(__dirname, 'standard.frag'));
const vertexShader = glslify(path.resolve(__dirname, 'standard.vert'));
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 1, 2024 20:51
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@EliCDavis
EliCDavis / WebGLBitwiseFunctions.shader
Created May 24, 2016 16:11
In absence of bitwise operators in WebGL 1.0, I used these methods as substitute.
// CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / /
// Notice the for loops have a hardcoded values for how far they can go (32)
// This is a result of WEBGL not allowing while loops. Change the value to what you find appropriate!
// CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / /
//
// Hopefully this gives you the format for making your own operators such as XOR, NAND, etc.
//
// Adapted from this thread:
// https://scratch.mit.edu/discuss/topic/97026/
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@tunght13488
tunght13488 / quadratic-bezier.js
Last active December 15, 2023 10:13
quadratic bezier curve length in javascript
/*
* http://en.wikipedia.org/wiki/B%C3%A9zier_curve
* http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/g
*/
function Point(x, y) {
this.x = x;
this.y = y;
}
@elsassph
elsassph / poop.js
Last active October 18, 2021 13:45 — forked from edankwan/poop.js
Array.prototype.poop = function() {
this.pop();
// return nothing, it's poop
}
Array.prototype.shit = function() {
this.shift();
// return nothing, it's poop
}
@Makio64
Makio64 / gist:3a684306445dc96aa048
Last active August 29, 2015 14:05
JS Class template / best practice
'use strict';
/**
* MyClass
*
* @class MyClass
* @author David Ronai http://makiopolis.com/ @Makio64
*/
@mseeley
mseeley / webworker-preloader.html
Created March 3, 2014 09:29
WebWorker Image preloader proof of concept (Tested in Mobile Safari 6.0/IOS 6.1.3 and Chrome 33)
<!DOCTYPE html>
<html>
<head>
<title>WebWorker image preloading</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
</head>
<body>
<div id="output"></div>
<script id="imgloader" type="javascript/worker">
// Not race proof or robust. Proof of concept.