Skip to content

Instantly share code, notes, and snippets.

View Apollinaire's full-sized avatar

Apollinaire Lecocq Apollinaire

View GitHub Profile
@Apollinaire
Apollinaire / collapse.ts
Created September 26, 2022 14:34
svelte-collapse ts mode
import type { Action } from 'svelte/action';
interface Params {
open: boolean;
duration: number;
easing: string;
}
const collapse: Action<HTMLElement, Params> = (node, argParams) => {
const defaultParams = {
@Apollinaire
Apollinaire / iso-usb.md
Last active March 15, 2023 15:36
Burn iso to usb on linux

1.insert your usb key

2.locate your usb key

sudo fdisk -l

probably /dev/sd*, * being a or b. The device is /dev/sd*, remove the number at the end if there is one.

@Apollinaire
Apollinaire / createS3StorageProvider.js
Created February 6, 2019 14:23
AWS-SDK update for vulcan-files-s3
import S3 from 'aws-sdk/clients/s3';
import curryUploadToS3 from './curryUploadToS3';
import curryDeleteFromS3 from './curryDeleteFromS3';
import serveFilesFromS3 from './serveFilesFromS3';
/**
* Creates an S3 storage provider, as needed by {@link createFSCollection}.
*
* @param {{key: String, secret: String, region: String, bucket: String}} config
* @param {String} cfdomain
@Apollinaire
Apollinaire / regex.js
Created January 18, 2019 11:06
Regex to find arrow functions with default value
const regEx = /\(.*(=+).*\) =>/;
// saved regex with examples: https://regex101.com/r/DcCtwT/1
// this will match the functions of this type:
const ArrowWithDefault = (argument = {whatever: 'abcdef'}) => {
return argument.whatever;
}
// NB: it won't match if the parenthesis are missing, or if the space before the arrow is missing
// the following will not match
import React from 'react';
import classNames from 'classnames';
import Input, {InputAdornment} from 'material-ui/Input';
import IconButton from 'material-ui/IconButton';
import { FormControl } from 'material-ui/Form';
import SearchIcon from 'mdi-material-ui/Magnify';
import {replaceComponent, getRawComponent} from 'meteor/vulcan:core';