Skip to content

Instantly share code, notes, and snippets.

View DWboutin's full-sized avatar
🎯
Focusing

Mike Boutin DWboutin

🎯
Focusing
  • Quebec city
View GitHub Profile
<!DOCTYPE html">
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>Exercice Sommatif 2</title>
</head>
<body>
@DWboutin
DWboutin / automatic-join-queue.js
Last active May 5, 2020 16:14
Turnip.exchange automatic join queue
var int = setInterval(function() {
var yourName = "Polle"
var button = document.querySelector('#app > div.view.bg-background.bg-center.col-start-2 > div.grid.gap-2 > div > button')
if(button.disabled === false) {
clearInterval(int)
button.click()
window.focus()
setTimeout(function() {
import React from 'react';
import { connect } from 'react-redux';
import { Responsive, WidthProvider } from 'react-grid-layout';
import { changeLayout, changeCurrentBreakpoint, changeWidgetOptions } from '../../actions/dashboard-actions';
import { fetch as fetchLayouts, create as createLayout } from '../../actions/layouts-actions';
import { fetch as fetchChartTypes } from '../../actions/chart-types-actions';
import {
fetch as fetchWidgets,
create as createWidget,
@DWboutin
DWboutin / angular-react-wrapper.ts
Created September 25, 2019 19:16
A minimalist wrapper to integrate React components in Angular with Angular-React
import { ReactWrapperComponent } from '@angular-react/core'
import {
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
NgZone,
OnInit,
Output,
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import omit from 'omit.js'
class Col extends React.Component {
colClasses(col, size) {
const classes = {}
classes[`col-${size}-${col.span}`] = col.span
@DWboutin
DWboutin / directUploadToS3.js
Created March 31, 2019 22:33
Direct image url to S3 wiht axios and nodejs
import AWS from 'aws-sdk';
import stream from 'stream'
import axios from 'axios';
export default async (url, filename, callback) => {
const s3 = new AWS.S3({ params: { Bucket: process.env.STATIC_MAPS_BUCKET }});
let contentType = 'application/octet-stream'
let promise = null
const uploadStream = () => {
@DWboutin
DWboutin / no-zoom.css
Created March 15, 2019 14:00
Remove zoom on IOS input focus
@media screen and (-webkit-min-device-pixel-ratio:0) {
input[type="email"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="password"]:hover,
textarea:hover,
select:hover{font-size: initial;}
import mockAxios from 'axios'
import AxiosClient from '../../src/Clients/AxiosClient'
describe('AxiosClient', () => {
test('calls axios.create on new instance', done => {
new AxiosClient({})
expect(mockAxios.create).toBeCalled()
done()
@DWboutin
DWboutin / app_filters.py
Created August 23, 2018 14:49
Django filter to transform HTML to a string with tags replaced by white spaces
from django import template
from django.utils.html import format_html
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='convert_tags_to_space')
@stringfilter
def convert_tags_to_space(value):
import re
@DWboutin
DWboutin / app_filters.py
Created August 23, 2018 14:48
Django filter to keep only wanted HTML tags
from django import template
from django.utils.html import format_html
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='keeptags')
@stringfilter
def keeptags(value, tags):
"""