Skip to content

Instantly share code, notes, and snippets.

View Unibozu's full-sized avatar

Clement Debiaune Unibozu

View GitHub Profile
@Unibozu
Unibozu / jest-domock.js
Last active May 30, 2018 08:45
implementation of jest.mock() that doesn't warn with duplicate module names
/**
* This function intends to work as jest.mock() but fixes issues with llocal modules sharing the same name but a
* different path. See https://github.com/facebook/jest/issues/2070
*
* Make sure that doMock() is called BEFORE the import and require as the calls are not hoisted like jest.mock()!
*
* It's used exactly as jest.mock() and will ensure the right mock is loaded without conflicts. You can provide a
* factory function so you don't have to worry when to use jest.mock() or doMock().
*
@Unibozu
Unibozu / README.md
Last active September 8, 2021 06:31
Shutter - Linux - dropbox automatic screenshot url to clipboard

Shutter - Dropbox automatic screenshot URL to Clipboard

Installation

  1. Configure shutter to save your screenshot directly intoyour dropbox public folder.
  2. Place dropbox-puburl.sh in the location of your choice (here ~/tools/bin/dropbox-puburl.sh)
  3. Place dropbox-screenshot-puburl.desktop into /usr/share/applications (you need to be root)
  4. Eventually update the path to your Bash script
  5. exec sudo update-desktop-database
  6. Quit and restart shutter. Go into Preferences > Actions > Open With and select Dropbox copy public file URL to clipboard
@Unibozu
Unibozu / Gruntfile.js
Last active August 29, 2015 14:16
Gruntfile.js fully featured skeleton / boilerplate
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'js/*.js'
]
@Unibozu
Unibozu / backup-mysql.sh
Last active August 29, 2015 14:05
Backup scripts
#!/bin/sh
#
# Usage
# ########
#
# This script backup all your user MySQL databases to a dedicated GZIP file (in a folder)
# while forcing a storage strategy to control disk space
# It is best used in a cron to perform hourly, daily, weekly and monthly backups
# Backups are stored in the target folder under : /folder/$PERIOD-YYMMDD-hhmm/mysql-$DB-$PERIOD-YYMMDD-hhmm.sql.gz
# Old backups are automatically deleted if too old