Skip to content

Instantly share code, notes, and snippets.

View juryghidinelli's full-sized avatar

Jury Ghidinelli juryghidinelli

  • Archimedia s.r.l.
View GitHub Profile
@xiejuncs
xiejuncs / knn.py
Last active March 14, 2024 15:24
KNN simple Python code example
# Use multiple to quantify the vector close or far away from the origin (query vector in this example).
def get_vector(dimension, multiple):
vector = []
for i in range(dimension):
vector.append(multiple * 0.000001)
return vector
def get_all_zero_vector(dimension):
vector = []
@dahlsailrunner
dahlsailrunner / SSL-nginx-Docker.md
Last active September 12, 2024 00:59
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

@dommmel
dommmel / compare_yml.rake
Created July 23, 2014 08:31
Rake task to compare keys in Rails locale.yml files
desc "TODO"
task :compare_yml, [:locale1, :locale2] => :environment do |t, args|
LOCALE_1 = "config/locales/#{args[:locale1]}.yml"
LOCALE_2 = "config/locales/#{args[:locale2]}.yml"
require 'yaml'
def flatten_keys(hash, prefix="")
keys = []
hash.keys.each do |key|
@egobude
egobude / install_netextender_ubuntu_64_bit
Last active December 17, 2021 11:22
Install NetExtender | Ubuntu 64 Bit
1. go to https://sslvpn.demo.sonicwall.com/cgi-bin/welcome
2. log in with demo/password
3. click on NetExtender icon, this will download a tar.gz with the client
4. sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.6
5. sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6
6. un-tar the client, make install script executable and launch install
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
@marijn
marijn / README.markdown
Last active August 27, 2024 22:31
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

List of countries

I've also compiled a list of countries