This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A script that can pull down the result of the introspection query | |
| // from a running graphql server. | |
| // Dependencies: | |
| // npm i -S isomorphic-fetch graphql-tag graphql apollo-client | |
| // Usage: | |
| // node fetch-graphql-schema [graphql url] | |
| // Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------------------------------------------- | |
| # {TYPE}: [{SCOPE}] {SUBJECT} What? | |
| # {BODY} Why? | |
| # {FOOTER} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # config.js | |
| const config = { | |
| ..., | |
| features: { | |
| ... | |
| }. | |
| ... | |
| } | |
| function feature (name) { | |
| return config.features[name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="editor"> | |
| <template v-if="editor && !loading"> | |
| <div class="count"> | |
| {{ count }} {{ count === 1 ? 'user' : 'users' }} connected to {{ projectPath }}/{{ docName }} | |
| </div> | |
| <editor-content class="editor__content" :editor="editor" /> | |
| </template> | |
| <em v-else> | |
| Connecting to socket server … |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const countries = [ | |
| "Afghanistan", | |
| "Albania", | |
| "Algeria", | |
| "Andorra", | |
| "Angola", | |
| "Antigua and Barbuda", | |
| "Argentina", | |
| "Armenia", | |
| "Australia", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.slugify = function (separator = '-') { | |
| return this.toString() | |
| .normalize('NFD') | |
| .replace(/[\u0300-\u036f]/g, '') | |
| .toLowerCase() | |
| .trim() | |
| .replace(/[^a-z0-9 ]/g, '') | |
| .replace(/\s+/g, separator) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fastify.get('/api/watch', async function (req, res) { | |
| const mp4Url = "https://download1319.mediafire.com/ky961ln87icg/cl1lndr4pyy4cv4/aAbnw92_460svav1+%281%29.mp4"; | |
| const response = await axios.get(mp4Url, { | |
| responseType: "stream", | |
| headers: { | |
| "User-Agent": | |
| "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36", | |
| }, | |
| }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # Si vous rencontrez une erreur du type `declare: -A: invalid option` | |
| # c’est qu’il vous faut mettre à jour votre version bash à v4. | |
| # Pour Mac OS, regardez ici : http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/ | |
| # Hash utilisant la clé comme expression de recherche (Regex) et la valeur | |
| # associée comme message d’erreur | |
| declare -A PATTERNS; | |
| PATTERNS['^[<>|=]{4,}']="Vous avez des marqueurs de conflits qui traînent"; | |
| PATTERNS['TODO|FIXME']="Vous avez des tâches non terminées (FIXME/TODO)"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Unicode 0x2680-0x2685 are the sides of a dice (⚀⚁⚂⚃⚄⚅) | |
| console.log('%c'+String.fromCodePoint(0x267f + Math.floor(Math.random() * 6) + 1), 'font-size: 4rem;') |
