Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mike Boutin DWboutin

🎯
Focusing
  • Quebec city
View GitHub Profile
@DWboutin
DWboutin / automatic-join-queue.js
Last active May 5, 2020
Turnip.exchange automatic join queue
View automatic-join-queue.js
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() {
View gist:03e60c46ec8b31a83d26fdef76ec7d10
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 Sep 25, 2019
A minimalist wrapper to integrate React components in Angular with Angular-React
View angular-react-wrapper.ts
import { ReactWrapperComponent } from '@angular-react/core'
import {
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
NgZone,
OnInit,
Output,
View Col.js
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 Mar 31, 2019
Direct image url to S3 wiht axios and nodejs
View directUploadToS3.js
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 Mar 15, 2019
Remove zoom on IOS input focus
View no-zoom.css
@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;}
View AxiosClient.test.tsx
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 Aug 23, 2018
Django filter to transform HTML to a string with tags replaced by white spaces
View app_filters.py
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 Aug 23, 2018
Django filter to keep only wanted HTML tags
View app_filters.py
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):
"""
@DWboutin
DWboutin / SCSS.md
Created Jul 11, 2018 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do
View SCSS.md

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso