Skip to content

Instantly share code, notes, and snippets.

View ammein's full-sized avatar

Amin Shazrin ammein

  • Revenue Monster Sdn Bhd
  • Malaysia
  • X @ammein
View GitHub Profile
const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
webpack: {
plugins: {
remove: ['ReactRefreshPlugin'],
add: [
new ReactRefreshPlugin({
exclude: [/^http.*/, /node_modules/],
@patriciogonzalezvivo
patriciogonzalezvivo / include.py
Last active January 14, 2024 23:38
Resolve includes for GLSL, HLSL and metal on Python
import re
from os.path import join, abspath, dirname, basename
def load_source( folder: str, filename: str, dependencies = []):
path = abspath( join(folder, filename) )
if path in dependencies:
return ""
else:
dependencies.append( path )
@vigonotion
vigonotion / export_as_primitive.py
Created June 25, 2019 17:31
Blender script to export as a geometry for three.js
import bpy, os
result = ""
obdata = bpy.context.object.data
result += 'Vertices: \n'
for v in obdata.vertices:
result += ('{}, {}, {}, '.format(v.co.x, v.co.z, v.co.y)) + '\n'
@didacus
didacus / property.js
Created February 7, 2019 08:53
Framer X — Property Controls
import * as React from 'react'
import { PropertyControls, ControlType } from 'framer'
// Define type of property
export interface Props {
text: string,
color: string,
boolean: boolean,
numberA: number,
numberB: number,
@theecrit
theecrit / Content-UX-Slack-CoC.mdown
Last active September 6, 2019 18:43 — forked from mjmetts/Content-UX-Slack-CoC.mdown
A Code of Conduct for the Content+UX Slack Group

UPDATE as of 9/3/19

This version of the Code of Conduct is now out of date. Please see https://contentandux.org/code-of-conduct for the most up-to-date version.

Code of Conduct

Last updated: June 11, 2019

The Content + UX Slack Group is dedicated to providing a harassment-free experience for everyone. We do not tolerate harassment of participants in any form.

This code of conduct applies to every member of the Content + UX Slack Group. Anyone who violates this code of conduct may be sanctioned or expelled from the Content + UX Slack Group at the discretion of the ADMIN TEAM.

@jayjariwala
jayjariwala / gist:c4e5b0442506e8cc38ea7f7b3024c42e
Last active June 15, 2018 14:59
Apostrophe in Production on Digital Ocean or any linux server
1) Create a droplet
You will recieve an email with root password information.
2) login using ssh though your local remote terminal (find your ipaddress on the digital ocean droplet control panel) or use ssh authentication
ssh root@ipaddress
password:write from email
change password upon first login
3) Once login as a root. update latest ubuntu packages
sudo apt-get install update
sudo apt-get install upgrade
4) Add a non-root user with root previlagies
@azu
azu / timer-logging.js
Last active June 1, 2021 07:16
Logging Timer and requestAnimationFrame
/**
* ## Usage
*
* 1. Load following script
* 2. `window.getContexualLogResult()` output the result to console
*
* ## Description
*
* - It spy "setTimeout", "setInterval", and "requestAnimationFrame".
* - Collect call count and collect stack trace.
@oskarbraten
oskarbraten / custom_shader_example.js
Created November 21, 2017 18:48
A three.js custom shader example
"use strict";
class MyCustomMaterial extends THREE.ShaderMaterial {
// constructor takes appropriate parameters.
// Default values using object destructuring (ES6)
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring
constructor({
color = 0xffffff,
emissive = 0x000000,
@Bjvanminnen
Bjvanminnen / instructions.md
Last active January 8, 2023 15:52
How to use glslify with create-react-app

Create your app

create-react-app my-app
cd my-app

Eject it, so that we can modify webpack config

npm run eject
y # when prompted
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
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