Skip to content

Instantly share code, notes, and snippets.

View MasatoMakino's full-sized avatar
🏠
Working from home

Masato Makino MasatoMakino

🏠
Working from home
View GitHub Profile
@bbudd
bbudd / assets.md
Created June 13, 2019 12:30
Loading static assets using electron-forge v6 and the webpack plugin

I spent a few hours chasing down just how to get my static assets (css, fonts, images) to load in an Electron app built using electron-forge v6 (https://www.electronforge.io/) and its webpack plugin (https://www.electronforge.io/config/plugins/webpack) while in development mode. There really isn't any documentation available online, either in the electron-forge documentation or in places like blogs or gists or stackoverflow. So I thought I'd put it down here.

Step 1

Load CopyWebpackPlugin npm i -D copy-webpack-plugin


Step 2

Use the plugin to move your directories into place.

@officeokano
officeokano / move-repos-bitbucket-to-github.md
Last active December 25, 2023 09:11
Bitbucket から Github に移行する方法

Bitbucket から Github に移行する方法

Github がプライベートリポジトリを無料開放したので Bitbucket から Github に移行しようと考える人も多いでしょう。 私はもともと目的によって使い分けていたものの、一部を Bitbucketから Github に移行しました。 やり方はそれほど難しくないものの、一部間違えるとうまく行かない点があるのでまとめてみました。

ローカルのリポジトリを移行準備する

まずはローカルのリポジトリを移行できるように準備します。

$ git pull
@regou
regou / gl_utils.js
Last active September 6, 2020 02:46
Test WebGL in jest
const THREE = global.THREE = require('three');
const headlessGl = require("gl");
const pngStream = require('three-png-stream');
const fs = require('fs');
const path = require('path');
const looksSame = require('looks-same');
const width = 400;
const height = 300;
@cecilemuller
cecilemuller / readme.md
Last active March 14, 2022 17:53
Using Three.js "examples" (e.g. OrbitControls) with Webpack 2

Javascript files from the examples folder (such as OrbitControls) are not CommonJS or ES Modules, but they can still be used in Webpack bundles:

In package.json:

"dependencies": {
	"three": "0.84.0",
	"webpack": "2.4.1"
}
@nicoptere
nicoptere / THREE.js lon_lat_to_cartesian
Last active January 16, 2023 09:56
methods to convert longitude / latitude to XYZ and back + utility polygon contains point for THREE.js
/**
* converts a XYZ vector3 to longitude latitude (Direct Polar)
* @param lng longitude
* @param lat latitude
* @param vector3 optional output vector3
* @returns a unit vector of the 3d position
*/
function lonLatToVector3( lng, lat, out )
{
out = out || new THREE.Vector3();
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active September 15, 2024 08:13
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@ondrek
ondrek / gist:7413434
Created November 11, 2013 13:48
Smallest Base64 image
data:image/gif;base64,R0lGODlhAQABAAAAACw=
@tamagokun
tamagokun / Console.as
Created July 27, 2011 20:02
AS3 Trace Console for Google Chrome/Firebug
package
{
import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.UncaughtErrorEvent;
import flash.external.ExternalInterface;
public class Console extends Sprite
{
public function Console():void