Skip to content

Instantly share code, notes, and snippets.

View Aarbel's full-sized avatar
✍️
.

Clement Fradet Normand Aarbel

✍️
.
View GitHub Profile
@Aarbel
Aarbel / embedded-file-viewer.md
Last active October 17, 2023 15:55 — forked from tzmartin/embedded-file-viewer.md
Free desktop and mobile files viewers and editors: Google Drive, OneDrive, Zoho public viewers and editors.

Desktop / Web

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

Format :

    http://view.officeapps.live.com/op/view.aspx?src=[ONLY_OFFICE_FILE_URL_ENCODED]
    
 
@donmccurdy
donmccurdy / FOO2GLTF.js
Last active August 1, 2023 06:53
Example Node.js glTF conversion script, using three.js.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const THREE = require('three');
const program = require('commander');
const Canvas = require('canvas');
const { Blob, FileReader } = require('vblob');
// Patch global scope to imitate browser environment.
@Aarbel
Aarbel / mouse-drag-click-control.js
Created August 17, 2018 23:48
Way to know if the mouse moved during a click, and prevent event on click if needed. Usefull for THREE.js camera rotation
let mouseMoved = false;
document.addEventListener('mousedown', () => {
mouseMoved = false;
}, false);
document.addEventListener('mousemove', () => {
mouseMoved = true;
}, false);
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@mtrunkat
mtrunkat / docker-mongo-repair
Last active March 19, 2024 06:28
Run "mongo --repair" in Docker container that cannot start because of MongoDB error
#!/bin/bash
# See https://github.com/docker-library/mongo/pull/63
docker run --rm --volumes-from my-mongo-server mongo unlink "/data/db/mongod.lock"
docker run --rm --volumes-from my-mongo-server mongo --repair
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 9, 2024 10:23
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@johnnyji
johnnyji / codemod-add-semicolon.js
Last active April 14, 2018 16:48
Codemod for Babel 6 Semicolon Requirement
module.exports = function (file, api) {
var j = api.jscodeshift;
var root = j(file.source);
// Finds the all classes that have properties
root
.find(j.ClassDeclaration, {
body: {
type: 'ClassBody',
body: [{
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@JakeSidSmith
JakeSidSmith / ellipsized-filenames.css
Last active March 13, 2019 17:42
CSS - ellipsis filename but keep extension
/* HTML
<div class="file">
<div class="icon"></div>
<span class="filename">
<span class="name">
Filename<span class="extension">.ext</span>
</span>
</span>
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 15, 2024 21:14
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k