Skip to content

Instantly share code, notes, and snippets.

View matinfo's full-sized avatar

Mathieu Meylan matinfo

  • Switzerland
View GitHub Profile
@korakot
korakot / plugin_domains.txt
Last active July 20, 2024 23:27
Chatgpt plugin domain list
dmtoolkit.magejosh.repl.co
seo-plugin.orrenprunckun.com
talkfpl.beegreeeen.workers.dev
videohighlight.com
aiplugin-experiences.owlting.com
www.nani.ooo
jetbook.click
imageeditor.dev
api.speedybrand.io
c-resume.copilot.us
@ChrisDobby
ChrisDobby / widthAndHeight.jsx
Created July 28, 2019 13:06
React component to display the width and height of the window
import React from "react";
function WidthAndHeight() {
const [width, setWidth] = React.useState(window.innerWidth);
const [height, setHeight] = React.useState(window.innerHeight);
React.useEffect(() => {
window.addEventListener("resize", updateWidthAndHeight);
return () => window.removeEventListener("resize", updateWidthAndHeight);
});
@chdsbd
chdsbd / slack-dnd.md
Created September 16, 2018 04:15
Disable Slack notifications for the weekend

Disable Slack notifications for the weekend

There isn't a way to configure DND for the weekend on Slack. However, you can use the /dnd 24 hours command to disable notifications for 24 hours using the [undocumented API][api] and [legacy tokens][token]. We're going to use the undocumented api and IFTTT to automate this.

Steps

  1. Generate a [token] for your account
  2. Navigate to your personal DM and copy the url (e.g. DAYM93S0N from acme.slack.com/messages/DAYM93S0N/convo/GBG661YR2-1536698414.000100/)
  3. Update the following url with your information (TOKEN looks like xoxp-4030334043-4959593942-3030320302032-sdf23rfasdf23rsf and CHANNEL looks like DAYM93S0N)
    https://slack.com/api/chat.command?token=xoxp-4030334043-4959593942-3030320302032-sdf23rfasdf23rsf&channel=DAYM93S0N&command=%2Fdnd&text=24%20hours
@matinfo
matinfo / App.vue
Last active July 20, 2018 13:55
RedactorEditor.vue
import Vue from 'vue'
import VeeValidate from 'vee-validate'
...
import RedactorEditor from './components/RedactorEditor.vue'
Vue.use(VeeValidate)
@nguyentamvinhlong
nguyentamvinhlong / rabbitmq-server-change-hostname.md
Last active July 8, 2021 16:49
rabbitmq-server change hostname

rabbitmq-server change hostname

Remove the old installation of RabbitMQ to fix this problem. Here are steps to reinstall RabbitMQ. These commands are run as the root user:

Stop RabbitMQ:

rabbitmqctl stop

Change

@Valian
Valian / example_forms.py
Last active February 8, 2021 14:32
Django MultipleFormMixin for displaying dynamic number of forms on the same page. Compatible with the standard FormMixin.
class ContactForm(forms.Form):
name = forms.CharField(max_length=60)
message = forms.CharField(max_length=200, widget=forms.TextInput)
class SubscriptionForm(forms.Form):
email = forms.EmailField()
want_spam = forms.BooleanField(required=False)
@armand1m
armand1m / Dockerfile
Last active March 10, 2024 14:54
Yarn cache compatible Dockerfile
FROM alpine
RUN apk add --update --no-cache nodejs
RUN npm i -g yarn
ADD package.json yarn.lock /tmp/
ADD .yarn-cache.tgz /
RUN cd /tmp && yarn
RUN mkdir -p /service && cd /service && ln -s /tmp/node_modules
@matinfo
matinfo / gist:96747456aab36ea34c2681433a2f594c
Created October 15, 2016 15:09
Handel max char left control for input and textarea with angularJS directive
// Handel max char left control for input and textarea
/* Set on your project this minumum css style (adapt for your need)
* mandatory for directive *maxlength-control*
*/
/*
.maxlength-control ~ .maxlength-control-status {
color: #b5b5b5;
float: right;
@moeseth
moeseth / waveform.py
Created October 12, 2015 08:19
Create Soundcloud style waveform from Audio in Python
from pydub import AudioSegment
from matplotlib import pyplot as plot
from PIL import Image, ImageDraw
import numpy as np
import os
src = "./test.mp3"
audio = AudioSegment.from_file(src)
data = np.fromstring(audio._data, np.int16)
@Vestride
Vestride / encoding-video.md
Last active November 15, 2024 17:57
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus