Skip to content

Instantly share code, notes, and snippets.

View logasja's full-sized avatar

Jacob Logas logasja

View GitHub Profile
@echo off
setlocal enableDelayedExpansion
for %%x in (%*) do (
for /f %%i in ('ipfs add -q "%%~x"') do echo https://gateway.ipfs.io/ipfs/%%~i
)
endlocal
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreihvn2jq6yvvoszyp2i6kemblvckslwu2z7ntmqwfelbe4kphodzoq ✅
Create your profile today to start building social connection and trust online at https://3Box.io/

Keybase proof

I hereby claim:

  • I am logasja on github.
  • I am rocketcode (https://keybase.io/rocketcode) on keybase.
  • I have a public key ASCJSqdM5_cYf0NYYNWdQf_WXPEuhyMkRheqFDfnLWo7dwo

To claim this, I am signing this object:

import socket, select
def main():
CONNECTION_LIST = [] # list of socket clients
RECV_BUFFER = 4096 # Advisable to keep it as an exponent of 2
PORT = 5000
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# this has no effect, why ?
server_socket.bind(("0.0.0.0", PORT))
@logasja
logasja / tcpserver.py
Last active August 4, 2023 19:32
A simple tcp server for python
# Socket server in python using select function
import socket, select
def main():
CONNECTION_LIST = [] # list of socket clients
RECV_BUFFER = 4096 # Advisable to keep it as an exponent of 2
PORT = 5000
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Courtesy of http://scikit-learn.org/stable/auto_examples/model_selection/plot_learning_curve.html
from matplotlib.colors import ListedColormap
import matplotlib.pyplot as plt
from sklearn.model_selection import learning_curve, GridSearchCV
from sklearn.metrics import confusion_matrix
import itertools
import matplotlib.pyplot as plt
import numpy as np
@logasja
logasja / data_utils.py
Created October 24, 2018 16:07
Useful data utils that I use across several of my projects.
__author__ = "j.logas"
from numpy.random import seed
from seaborn import load_dataset
import pandas as pd
from sklearn.datasets import make_moons
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
def moons_data():