Skip to content

Instantly share code, notes, and snippets.

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
# Careful, seems like manjaro already uses /etc/sysctl.d/40 to define a lower value
@landrysoules
landrysoules / gist:4055efc8d12b6763b5a20e3efe513b64
Last active April 4, 2020 11:34
Create a dedicated folder for Emby
sudo systemctl enable emby-server.service
sudo systemctl start emby-server.service
sudo mkdir /mediafiles
sudo groupadd multimedia
sudo gpasswd -a emby multimedia
sudo gpasswd -a landry multimedia
sudo chown emby:multimedia /mediafiles
sudo chmod -R g+rwx /mediafiles
@landrysoules
landrysoules / FormValidationHelper.js
Last active September 30, 2019 07:07
Example of using dynamic function call via map + reduce for adding boolean values
const validate = (value, allValues, meta, validationTypes) => {
const ret = validationTypes.reduce((sum, next) => {
console.debug({ sum, next });
return sum && next(value, allValues, meta);
}, true);
console.debug('V_A_L_I_D_AT_I_O_N_', ret);
return ret;
};
const required = value => {
@landrysoules
landrysoules / AuditModelBuilder.js
Last active September 6, 2019 06:51
Simplifier le code sur des closures :
<FieldArray name="sections" subscription={{}}>
{({ fields }) => {
return (
<SortableContainer onSortEnd={fields.move} useDragHandle>
{fields.map((name, index) => (
<AuditModelSection
key={name}
sectionIndex={index}
index={index}
moveSection={fields.move}
import React from 'react';
import { Row, Col, Title, Tabs, Loader } from '../../../../ui/base';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
import ContactForm from './ContactForm';
import PropTypes from 'prop-types';
import { pick, isEmpty } from 'ramda';
const TabPane = Tabs.TabPane;
const Contact = ({ form, intl, brands, selectedDealer }) => {
@landrysoules
landrysoules / Config.js
Created May 22, 2019 13:11
Example of functionnal connected component
import React, { useEffect } from 'react';
import ActionBar from '../../../ui/layout/ActionBar';
import {
getDealersSelect,
getSelectedDealer,
getSelectedDealerId,
getDealersIsFetching,
getDealersLinks,
getDealersApiError
} from '../../../../selectors/dealerSelectors';
@landrysoules
landrysoules / cloudSettings
Last active May 14, 2020 06:02
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-03-29T16:44:03.590Z","extensionVersion":"v3.4.3"}
@landrysoules
landrysoules / 17.06.sh
Created November 3, 2017 22:37
Edited docker install script for fedora
#!/bin/sh
set -e
CHANNEL="stable"
docker_version=17.06.2
apt_url="https://apt.dockerproject.org"
yum_url="https://yum.dockerproject.org"
gpg_fingerprint="9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
@landrysoules
landrysoules / navbar.html
Last active August 29, 2015 14:05
navbar.html
<form class="navbar-form navbar-right" id="user_form" name="user_form"
novalidate>
<div>
<div class="form-group">
<label for="email_field">email</label> <input class=
"form-control" id="email_field" name="username" required=""
type="email"> <span class=
"glyphicon glyphicon-remove form-control-feedback"></span>
</div>