Xvfb :99 &
export DISPLAY=:99
ruby headless.rb
This file contains 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
package main | |
import "fmt" | |
type person struct { | |
name string | |
age int | |
} | |
func (p person) print() { |
This file contains 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
from sympy import * | |
from sympy.abc import k | |
B=Matrix([[1, .5], [.5, 1]]) | |
print(B.eigenvals()) | |
A=Matrix([[1+k, .5], [.5, 1+k]]) | |
print(A.eigenvals()) | |
A=Matrix([[1+k, .5, 1], [.5, 1+k, 1],[.5, 1, 1+k]]) | |
print(A.eigenvals()) |
This file contains 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
import numpy as np | |
import matplotlib.pyplot as plt | |
n_dimensions = 2 | |
A = np.random.rand(n_dimensions) # source | |
B = np.random.rand(n_dimensions) # target | |
# linear function | |
n_steps = 50 | |
delta = (A-B)/n_steps |
This file contains 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
""" Worker will wail to another to finish a task in order to do some procedure | |
""" | |
import threading | |
import logging | |
import time | |
logging.basicConfig(level=logging.DEBUG, | |
format='(%(threadName)-10s) %(message)s',) | |
def worker(lock, seconds=2): |
This file contains 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
wb=openpyxl.load_workbook("doc.xlsx") | |
sheet, inrange=list(wb.defined_names["MYDEFINEDNAME"].destinations)[0] | |
[xy.value for xy in x] for x in wb[sheet][inrange]] |
This file contains 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
# newest version for Mozilla Firefox 81.0.2 | |
javascript:/*PDF - toggle filter invert*/(function(){var L='style_PDFI',S='#viewerContainer>#viewer.pdfViewer>.page{filter: invert(100%)}',SS,E=document.querySelector('style[id="'+L+'"]');if(E){SS=E.disabled;E.disabled=(SS==true)?false:true}else{SS=document.createElement('style');SS.setAttribute('type','text/css');SS.id=L;SS.innerHTML=S;document.querySelector('head').appendChild(SS); document.querySelectorAll("#viewerContainer>#viewer.pdfViewer>.page").forEach(e=>e.style.border="10px solid rgba(0, 0, 0, 0)"); document.querySelector("#viewerContainer>#viewer.pdfViewer").style.background="#666"; document.querySelector("#toolbarViewer").style.background="#999"; document.querySelector("#toolbarViewer").style.borderBottom="#999 solid 1px"; document.querySelector("#toolbarSidebar").style.background="#999";document.querySelector("#outlineView").style.background="#bbb"}})() | |
# my bookmarklet | |
javascript:/*PDF - toggle filter invert*/(function(){var L='style_PDFI',S='#viewerC |
This file contains 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
#extracted from: https://www.scrapehero.com/how-to-rotate-proxies-and-ip-addresses-using-python-3/ | |
import requests | |
from lxml.html import fromstring | |
def get_proxies(): | |
url = 'https://free-proxy-list.net/' | |
response = requests.get(url) | |
parser = fromstring(response.text) | |
proxies = set() | |
for i in parser.xpath('//tbody/tr'): | |
if i.xpath('.//td[7][contains(text(),"yes")]'): |
This file contains 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
# based on: | |
# https://stackoverflow.com/a/882770/2237916 | |
# https://stackoverflow.com/a/53970596/2237916 | |
import smtplib | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from os.path import basename |
This file contains 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
import pandas_datareader as pdr | |
import matplotlib.pyplot as plt | |
from statsmodels.tsa.arima_model import ARIMA | |
from scipy.signal import find_peaks | |
data = pdr.get_data_yahoo("FR.PA") | |
data_ = data[data.index>"2017"] | |
# find_peaks(data_["Volume"]) |