Skip to content

Instantly share code, notes, and snippets.

Cecile Muller cecilemuller

Block or report user

Report or block cecilemuller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cecilemuller
cecilemuller / mjpeg.js
Last active Jul 8, 2019
Emit a looped serie of images as an MJPEG stream using Node.js
View mjpeg.js
'use strict';
const {readFileSync} = require('fs');
const {createServer} = require('http');
const {EventEmitter} = require('events');
let bufferIndex = -1;
const buffers = [
readFileSync('1.jpg'),
readFileSync('2.jpg'),
readFileSync('3.jpg'),
@cecilemuller
cecilemuller / readme.md
Last active Jun 26, 2019
Using Three.js "examples" (e.g. OrbitControls) with Webpack 2
View readme.md

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"
}
@cecilemuller
cecilemuller / minify.php
Last active Jun 17, 2019
PHP function to minify JavaScript code using Google Closure Compiler
View minify.php
<?php
/**
* Minifies JavaScript code using Google Closure Compiler.
*
* @param String $code
* JavaScript code to reduce
*
* @param String $level
* Type of compression of the code.
@cecilemuller
cecilemuller / classes.bootstrap.js
Last active May 12, 2019
Dynamically-generated (and optionally multi-steps) modals for Bootstrap 2.3.2
View classes.bootstrap.js
(function() {
"use strict";
/**
* @namespace
*/
var BOOTSTRAP = {};
/**
@cecilemuller
cecilemuller / cubemap.bat
Created May 1, 2019
Generate a DDS cubemap from 6 JPEG images
View cubemap.bat
texassemble cube -w 1024 -h 1024 -o cubemap.dds px.jpg nx.jpg py.jpg ny.jpg pz.jpg nz.jpg
texconv cubemap.dds -m 0 -y -f BC1_UNORM
@cecilemuller
cecilemuller / marmoset-material-fields.md
Last active Apr 28, 2019
Marmoset Toolbag: Shader subroutine fields
View marmoset-material-fields.md
@cecilemuller
cecilemuller / activeshade.ms
Created Apr 24, 2019
Maxscript: ActiveShade
View activeshade.ms
-- Open activeshade floater
actionMan.executeAction 0 "40701"
-- Close activeshade floater
local children = UIAccessor.GetPopupDialogs()
for child in children do (
local windowTitle = (UIAccessor.getWindowText child)
if matchPattern windowTitle pattern:"ActiveShade *" ignoreCase:false do (
UIAccessor.closeDialog child
exit
View photoshop-functions.js
/* eslint-env photoshop */
/**
* New 3D Layer from File.
* @param {String} modelFilepath Absolute path to the 3D file
*
* Examples:
* `addLayer3D('C:\\example\\scene.wrl');`
* `addLayer3D('C:\\example\\scene.dae');`
* `addLayer3D('C:\\example\\scene.obj');`
@cecilemuller
cecilemuller / gist:1973197
Created Mar 4, 2012
Programmatically change the active theme in Drupal 6
View gist:1973197
<?php
function MODULENAME_init(){
global $custom_theme;
$custom_theme = 'garland';
}
/**
* Theme name callback: without parameters.
@cecilemuller
cecilemuller / gist:1973201
Created Mar 4, 2012
Programmatically change the active theme in Drupal 7
View gist:1973201
<?php
/**
* Defines a theme callback function per registered path.
*/
function MODULENAME_menu_alter(&$items) {
$items['node/%node']['theme callback'] = 'MODULENAME_default_node_theme';
$items['node/%node/edit']['theme callback'] = 'MODULENAME_edit_node_theme';
$items['node/%node/edit']['theme arguments'] = array(1);
}
You can’t perform that action at this time.