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
for folder in $(ls -d */); do | |
cd $folder | |
echo | |
echo =========================== | |
echo $folder | |
echo =========================== | |
for branch in $(git branch -r | grep -v HEAD | cut -d / -f 2,3,4,5); do | |
echo | |
echo "=>" $branch |
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
UPDATE mysql.user SET Super_Priv='Y' WHERE user='<myuser>' AND host='localhost'; |
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
:: Prerequisite: git | |
:: Usage: Download the wizard | |
:: Create a file named "repos.txt" in the same folder of the wizard | |
:: Insert in the file the absolute path of the repositories to track, one per line | |
:: Double click on the wizard and follow the instructions | |
:: Contribution: Feel free to contribute to this script! | |
:: Credits: Edoardo Vignati <edoardo.vignati@akkodis.com> | |
:: Emanuele De Filippis <emanuele.defilippis@akkodis.com> | |
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
map.on("singleclick", function(e) { | |
feature = map.forEachFeatureAtPixel(e.pixel, function(feature) { | |
return feature; | |
}); | |
var coord = feature.getGeometry().getCoordinates(); | |
coord = ol.proj.transform(coord,"EPSG:3857","EPSG:4326"); | |
console.log(coord); | |
}); | |
map.on("pointermove", function (evt) { |
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
==== my_main.cpp ==== | |
#include <iostream> | |
#include "my_vector.hpp" | |
using namespace std; | |
int main() | |
{ | |
vector<int> myvec = {1, 2, 3}; | |
add_to_vector(myvec, 4); | |
for(int elem : myvec){ | |
cout << elem << endl; |
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
def convert_bool_array_to_int(bool_array): | |
to_str_array = [str(int(x)) for x in bool_array] | |
return int("".join(to_str_array), 2) | |
def convert_int_to_bool(int_value): | |
to_byte_string = "{0:b}".format(int(int_value)).rjust(5, "0") | |
return [x == "1" for x in to_byte_string] |
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
#!/usr/bin/env python | |
# Updated in june 2022 | |
import sys | |
import requests | |
import re | |
if len(sys.argv) != 2 or sys.argv[1] == "": | |
print("Provide a valid Facebook url page such as \"https://www.facebook.com/acme\"") | |
exit() | |
try: |
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 werkzeug.utils import secure_filename | |
from flask import Flask, render_template, request | |
@app.route("/my-upload-endpoint", methods=["POST"]) | |
def my_upload_function(): | |
if request.files.get("my-file-field-name") is None: | |
return render_template("my_error_page.html", an_optional_message="Error uploading file") | |
# Put here some other checks (security, file length etc...) | |
f = request.files["my-file-field-name"] | |
f.save(secure_filename(f.filename)) |
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
find . -type f -exec du -b {} + | grep something.txt |
NewerOlder