Skip to content

Instantly share code, notes, and snippets.

PyInstaller Quickstart

Install PyInstaller from PyPI:

pip install pyinstaller

Go to your program’s directory and run:

pyinstaller yourprogram.py

It will generate an executable in a dist folder

from functools import reduce
from sympy import Symbol
X = Symbol('X')
def Lagrange(points):
P=[reduce((lambda x,y: x*y),[(X-points[j][0])/(points[i][0] - points[j][0]) for j in range(len(points)) if i != j])*points[i][1] for i in range(len(points))]
return sum(P)
@Eddy-Barraud
Eddy-Barraud / random_alphanum.py
Created September 21, 2018 18:50
generate a random alphanumeric string with 16 keys
## generate a random alphanumeric string with 16 keys
import random, string
x = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
print(x)

Mount on O: drive letter your onedrive root folder as webdav and save the credentials.

net use O: https://d.docs.live.net/{cid}/ /savecred /p:yes

Detailled tuto here

//Supprimer les scripts et css de la page d'accueil
function remove_scripts_home() {
if (is_home()){
wp_dequeue_script( 'script_handle' );
wp_deregister_script( 'script_handle' );
}
}
add_action('wp_print_scripts', 'remove_scripts_home', 100);
// list loaded assets by our theme and plugins so we know what we're dealing with. This is viewed by admin users only.
add_action('wp_print_footer_scripts', 'wra_list_assets', 900000);
function wra_list_assets(){
if ( !is_admin() ){
return;
}
echo '<h2>List of all scripts loaded on this particular page.</h2>';
echo '<p>This can differ from page to page depending of what is loaded in that particular page.</p>';
<head>
<!-- Import the amp-gist component -->
<script async custom-element="amp-gist" src="https://cdn.ampproject.org/v0/amp-gist-0.1.js"></script>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<style amp-custom>
amp-gist {
margin: 1rem;
}
</style>
</head>
@Eddy-Barraud
Eddy-Barraud / phoronix-cmd.md
Last active September 2, 2018 14:05 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@Eddy-Barraud
Eddy-Barraud / benchmark.md
Last active June 2, 2020 17:10
benchmark

Easily benchmarking any computer

  • disk

    #very litle files 
    dd if=/dev/zero of=/tmp/output bs=1024 count=100k; rm -f /tmp/output
    #litle files 
    dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output
    #big files 
    dd if=/dev/zero of=/tmp/output bs=8M count=10; rm -f /tmp/output
    #biggest files 

Folder location of Win+X menus :

%LocalAppData%\Microsoft\Windows\WinX

SoftWare to edit the menus here