Skip to content

Instantly share code, notes, and snippets.

View 90vFan's full-sized avatar
🎯
Focusing

90vFan 90vFan

🎯
Focusing
View GitHub Profile
#! Robot Framework
*** Settings ***
Metadata Version 0.1.0
Metadata Author *Tset Noitamotua*
Metadata Created 2019.01.23
Documentation Demo - Data Driven Test with RF
...
@90vFan
90vFan / Singleton.ipynb
Created November 12, 2020 10:26
Singleton demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@90vFan
90vFan / DotDict.py
Created May 7, 2020 02:55
Format python dict to be dot.notation accessible
class DotDict(dict):
"""dot.notation access to dictionary attributes"""
__getattr__ = dict.get
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
@90vFan
90vFan / gist:d5d83958abc567f72aa547ef7f72aa1b
Last active June 15, 2020 09:56
How to start a new git branch and apply all changes
$ git checkout master
$ git pull
$ git checkout dev-branch
$ git diff master dev-branch > /tmp/dev-branch.patch
$ cat /tmp/dev-branch.patch
$ git checkout master
$ git pull
$ git checkout -b dev-branch-new
@90vFan
90vFan / download.py
Created March 19, 2020 03:25 — forked from khardix/download.py
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@90vFan
90vFan / send_log_to_graylog.md
Last active February 27, 2020 08:09
How to send log to graylog with http
@90vFan
90vFan / requests_download_file.py
Created February 11, 2020 07:10
Download file with requests stream and write by iterating chunks
def download_file(url):
local_filename = url.split('/')[-1]
# NOTE the stream=True parameter below
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
# f.flush()
@90vFan
90vFan / jmeter-plugins
Created January 7, 2020 13:33
Dockerfile for JMeter Plugins
FROM egaillardon/jmeter:5.2.0-1.0.0
LABEL maintainer="emmanuel.gaillardon@orange.fr"
ENV JMETER_PLUGINS_MANAGER_VERSION 1.3
ENV CMDRUNNER_VERSION 2.2
ENV JSON_LIB_VERSION 2.4
ENV JSON_LIB_FULL_VERSION ${JSON_LIB_VERSION}-jdk15
ENV NUMBER_OF_FILES_UNDER_LIB 161
ENV NUMBER_OF_FILES_UNDER_LIB_EXT 78
RUN cd /tmp/ \
&& curl --location --silent --show-error --output ${JMETER_HOME}/lib/ext/jmeter-plugins-manager-${JMETER_PLUGINS_MANAGER_VERSION}.jar http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/${JMETER_PLUGINS_MANAGER_VERSION}/jmeter-plugins-manager-${JMETER_PLUGINS_MANAGER_VERSION}.jar \
@90vFan
90vFan / generator_yield.ipynb
Created November 19, 2019 07:27
Generator yield and exhaustion
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@90vFan
90vFan / parallel_promise.js
Created October 15, 2019 03:12
Get data in parallel from different URLs, and assemble data for use in next step asynchronously.
let allData = []
const promises = urlArr.map(async url => {
const response = await utils.fetch(url);
allData = allData.concat(response.data)
})
try {
Promise
.all(promises)
.then(() => {