Skip to content

Instantly share code, notes, and snippets.

View ranadeep47's full-sized avatar
🎯
Focusing

Ranadeep ranadeep47

🎯
Focusing
View GitHub Profile
@ranadeep47
ranadeep47 / three-uvToGlobal.js
Created November 9, 2020 14:18 — forked from paulzi/three-uvToGlobal.js
Transform UV coordinate to global (Three.js)
/**
* @param {THREE.Mesh} mesh
* @param {THREE.Vector2} point
* @returns {THREE.Vector3[]}
*/
var uvToGlobal = function (mesh, point) {
var a, b, c, i, uv, face, uvs, faces, vertices, matrix, matrix2, point3, result;
result = [];
uvs = mesh.geometry.faceVertexUvs[0];
faces = mesh.geometry.faces;
@ranadeep47
ranadeep47 / image_save.sh
Created April 30, 2018 18:02 — forked from tommeier/image_save.sh
Bash script to download list of image urls to a location
while read p; do
echo "SAVING : $p"
filename=$(basename "$p")
extension="${filename##*.}"
filename="${filename%.*}"
echo " -- Filename : $filename"
curl -o "/file/save/location/$filename.$extension" "$p"
done < /soure/url/list/image_list.txt
@ranadeep47
ranadeep47 / url_regexp
Last active August 29, 2015 14:06
Regular expression for matching url
module.exports = function () {
return /(^|\s)((?:(?:\w+:)?\/\/)|(www.))+(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)*(?=\s|$)/gi;
};