Skip to content

Instantly share code, notes, and snippets.

View emilio-martinez's full-sized avatar
🙃

Emilio Martinez emilio-martinez

🙃
View GitHub Profile
@emilio-martinez
emilio-martinez / alibaba-vendor.md
Last active November 11, 2024 16:09
Topin 365GPS Server config

365GPS office address Contact: Erik Liu Address: 505 Block B, Donglian Building, Chuangye Second Road, Baoan District, Shenzhen, Guangdong, China(广东省深圳市宝安区创业二路东联大厦B座505,洪浪北地铁站旁) Mobile/ wechat/ whatsapp: +86-13480999031
Alibaba: 365gps.en.alibaba.com Skype: topin.sales
E-mail: [email protected]

============================================================= Hi

@emilio-martinez
emilio-martinez / README.md
Created March 18, 2020 18:56
Sitecore query string mode params

Sitecore query string mode params

Normal, normal, normal mode

?sc_mode=normal&sc_debug=0&sc_trace=0&sc_prof=0&sc_ri=0&sc_rb=0&sc_expview=0

@emilio-martinez
emilio-martinez / writeWebpackConfigToFile.js
Last active March 8, 2020 08:50
Rough function to write a Webpack config to a file
const { writeFileSync } = require('fs-extra');
const { EOL } = require('os');
/**
* Function to write a Webpack config to a file.
* Helpful when debugging a Webpack config from a tool or library.
* Several aspects here could be improved, but this is merely a rough take.
*
* @param {string} destPath
* @param {import('webpack').Configuration} config

npx script template

@emilio-martinez
emilio-martinez / README.md
Last active September 19, 2023 18:04
npx-git-diff-name-status

This script calls git diff --name-status and optionally adds --diff-filter when using --filter.

Examples: npx ./index.js v1.0.0 npx ./index.js v1.0.0 --filter mr

An argument of <revision>, <revision>..<revision>, or <revision>...<revision> is required to pass to git diff. See https://git-scm.com/docs/git-diff for more info.

@emilio-martinez
emilio-martinez / roundToMultipleOf.js
Created December 8, 2017 03:45
roundToMultipleOf
function roundToMultipleOf(multipleOf) {
const factor = 1 / multipleOf;
return num => Math.round(num * factor) / factor;
}
/**
* EXAMPLE
* Rounding to the closest multiple of five
*/
const roundToMultipleOfFive = roundToMultipleOf(5);
@emilio-martinez
emilio-martinez / base64-as-texture-threejs.js
Created November 20, 2017 08:57
Base64 Image Data as Texture in ThreeJS
// Create an image
const image = new Image(); // or document.createElement('img' );
// Create texture
var texture = new THREE.Texture(image);
// On image load, update texture
image.onload = () => { texture.needsUpdate = true };
// Set image source
image.src = 'data:image/png;base64,XXXXX';
/* Source: https://bitsofco.de/the-new-system-font-stack/ */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}