Skip to content

Instantly share code, notes, and snippets.

View yoannmoinet's full-sized avatar
🐶
DX and Tooling

Yoann Moinet yoannmoinet

🐶
DX and Tooling
View GitHub Profile
@yoannmoinet
yoannmoinet / .vimrc
Created August 12, 2014 13:32 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@yoannmoinet
yoannmoinet / symlinks_all.sh
Last active August 29, 2015 14:05
Dotfiles transfert from sync folder to new machine.
/*
* Enhances 'require' from RequireJS with Promises API while preserving its original semantics.
*/
(function() {
if (!Promise || !require) {
return;
}
@yoannmoinet
yoannmoinet / logStack.js
Last active February 3, 2016 18:19
Will output in the console what the stack is at the moment this is called.
// nb [int] the number of line to get from the stack
function logStack (nb) {
try {
throw new Error();
} catch (e) {
var stack = e.stack.match(/(https?:\/\/[\w.:0-9\/]+)/g);
if (nb === undefined) {
nb = stack.length - 2;
}
console.log(
### Keybase proof
I hereby claim:
* I am yoannmoinet on github.
* I am yoannmoinet (https://keybase.io/yoannmoinet) on keybase.
* I have a public key whose fingerprint is 1E06 D01B CA96 C8CD 06F7 E262 3A23 D567 FF21 3F18
To claim this, I am signing this object:
{
"name": "Testing File"
}
@yoannmoinet
yoannmoinet / removeFolders.js
Last active November 6, 2017 13:23
Remove *.lproj folders
import path from 'path';
import glob from 'glob';
import fs from 'fs-extra';
export const cleanLanguages = (buildPath) => {
// Target only English and French.
const lprojRegEx = /(en|fr)\.lproj/g;
const cwd = path.join(buildPath, `Fenêtre.app/Contents/Resources`);
const lproj = glob.sync('*.lproj', { cwd });
const proms = [];
@yoannmoinet
yoannmoinet / windowExists.js
Last active November 4, 2017 19:39
Check for the existence of a BrowserWindow
const windowExists = (w) => {
if (!w || (w && w.isDestroyed())) {
return false;
}
return true;
};
@yoannmoinet
yoannmoinet / watchClipboard.js
Last active November 4, 2017 19:42
Keep the clipboard watcher alive.
import { powerSaveBlocker} from 'electron';
let clipboardValue;
powerSaveBlocker.start('prevent-app-suspension');
setInterval(() => {
clipboardValue = clipboard.readText();
}, 1000);
@yoannmoinet
yoannmoinet / activatePlugins.js
Last active November 7, 2017 08:23
Activate plugins in Electron
import { app } from 'electron';
import path from 'path';
import {
WIDEVINE_PATH,
WIDEVINE_VERSION,
PEPPERFLASH_PATH,
PEPPERFLASH_VERSION
} from './config';
app.commandLine.appendSwitch('widevine-cdm-path', path.join(__dirname, WIDEVINE_PATH));