Skip to content

Instantly share code, notes, and snippets.

View Musinux's full-sized avatar

Louis Cherel Musinux

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
struct conteneur {
struct contenu1* one;
struct contenu2* two;
};
struct contenu1 {
int couleur;
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char auteur[10];
char contenu[10];
} T_livre;
int main () {
T_livre tab[10]; // 10 * 20 octets
const express = require('express')
const router = express.Router()
const wrapper = require('../../wrapper')
const config = require('../../config')
const requestBuilder = require('../../utils/requestBuilder')
router.get('/', (req, res) => {
res.render('playlists.ejs')
})
let removeDuplicate = (v, i, a) => a.indexOf(v) === i
async function getSymbolsNames (quoteAsset = 'BTC') {
// exchangeInfo : timezone , serverTime , rateLimits , exchangeFilters , symbols
// symbolsInfo : symbol, baseAsset, quoteAsset, status, icebergAllowed, orderTypes, filters
// orderTypes : [ 'LIMIT', 'LIMIT_MAKER', 'MARKET', 'STOP_LOSS_LIMIT', 'TAKE_PROFIT_LIMIT' ]
let exchangeInfo = await client.exchangeInfo()
let symbolsInfo = exchangeInfo.symbols
symbolsInfo = symbolsInfo.filter(elem => elem.status === 'TRADING')
symbolsInfo = symbolsInfo.filter(elem => elem.quoteAsset === quoteAsset)
const Axios = require('axios')
exports.startToEndProcessQuery = function (req, res) {
return Axios.get('/explore.articlesearch.v1/favouriteSearch?edismax=true&storeId=00016&language=fr-FR&country=FR&query=' + req.params.str + '&rows=1000&page=1&profile=orSearch&null&__t=1541347156148')
.then(function (response) {
let stringIds = ''
let limits = response.data.regularResults.resultIds.length > 50 ? 50 : response.data.regularResults.resultIds.length
for (let i = 0; i < limits; i++) {
stringIds += response.data.regularResults.resultIds[i] + '&ids='
}
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<nav>
/* globals Vue */
;(function () {
'use strict'
const template = `
<section id="accueil">
<h1>Titre de ma page d'accueil</h1>
<p>Mon super texte</p>
</section>
`
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<style>
nav ul li {
display: inline-block;
border: 1px solid red;
width: 200px;
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<style>
nav ul li {
display: inline-block;
border: 1px solid red;
width: 200px;
@Musinux
Musinux / cssToInlineStyle.js
Created July 4, 2018 07:48
Node.js implementation of transforming a <style> tag to inline style. Useful to tranform Google Documents into Email-compatible format
const cssParser = require('css')
const { JSDOM } = require('jsdom')
function cssToInlineStyle (inputHtml) {
let style = inputHtml.match(/(?:<style[^>]*>)((?:[\r\n]|.)*?)(?:<\/style>)/)
const html = inputHtml.replace(/<style[^>]*>(([\r\n]|.)*?)<\/style>/, '')
if (!style) {
throw new Error('error while parsing')
}