Skip to content

Instantly share code, notes, and snippets.

View marcolussetti's full-sized avatar

Marco Lussetti marcolussetti

View GitHub Profile
@mdo
mdo / 00-intro.md
Last active August 6, 2025 19:58
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@tylerneylon
tylerneylon / mnist.py
Last active December 22, 2024 20:15
A function to load numpy arrays from the MNIST data files.
""" A function that can read MNIST's idx file format into numpy arrays.
The MNIST data files can be downloaded from here:
http://yann.lecun.com/exdb/mnist/
This relies on the fact that the MNIST dataset consistently uses
unsigned char types with their data segments.
"""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
import json
import requests
import json,re
from dateutil import parser as dateparser
from time import sleep
@walm
walm / main.go
Last active July 24, 2025 21:10
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@webserveis
webserveis / material text sizes.md
Last active August 10, 2024 02:29 — forked from passsy/material text sizes.md
Material font sizes

Material text sizes XML for Android

Simple helper file for standard text sizes in material design. The sizes are provided by the material design documentation https://www.google.com/design/spec/style/typography.html#typography-roboto

material typography

Standard Styles

Too many type sizes and styles at once can wreck any layout. A typographic scale is a limited set of type sizes that work well together, along with the layout grid. The basic set of styles are based on a typographic scale of 12, 14, 16, 20, and 34.

@marcolussetti
marcolussetti / runallclasses.bat
Last active September 27, 2016 01:18
Workaround for DrJava autoimport issue: runs all compiled java classes in the current directory
@echo off
for %%f in (%cd%\*.class) do (
echo #### Running %%~nf ####
java %%~nf
echo.
echo.)
set /p end="Press anything to exit!"
@nepsilon
nepsilon / git-change-commit-messages.md
Last active November 19, 2024 18:18
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@Restuta
Restuta / the-bind-problem.jsx
Last active March 16, 2024 00:22
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
@kevin39
kevin39 / HAPROXY LDAP SETTINGS - WINDOWS COMPATIBLE
Last active March 14, 2022 21:29
HAProxy ldap-check compatible with Windows Server / Active Directory
# Note : Found somewhere on internet... Source lost
backend ldap_balancer
mode tcp
balance roundrobin
server SERVER_NAME SERVER_ADDR:389 maxconn 100 check
option tcpka
timeout server 2s
timeout connect 1s
# Below, ldap check procedure :
option tcp-check
@slaporte
slaporte / Recent Changes Feed.md
Created February 3, 2015 17:32
Recent changes feed documentation

Introduction

The recent changes stream is a live, public feed of activity on all Wikimedia wikis, including Wikipedia, available in over 270 languages. Using the recent changes stream, you can build applications on top of the massive amount of realtime data from Wikipedia. This data powers projects that identify trending news topics, sonify and visualize Wikipedia edits, monitor edits from US Congress, and more.

Connecting

An application can connect to the recent changes stream with a SocketIO client. First, connect to stream.wikimedia.org/rc. Then, subscribe to any Wikimedia wiki in the format [language code].[wiki].org.

For example, to connect and subscribe to English Wikipedia: