Skip to content

Instantly share code, notes, and snippets.

View math2001's full-sized avatar

Mathieu PATUREL math2001

View GitHub Profile
@math2001
math2001 / Revert sublime text 3 to a fresh state.md
Last active March 21, 2024 13:34
Revert Sublime Text 3 to a fresh state step by step 🙂

[UPDATE] Sublime Text 4

If you have the latest sublime text (version 4), you can just do:

subl --safe-mode

How do I revert Sublime Text 3 to a fresh state

@math2001
math2001 / minimap_setting.py
Last active August 14, 2021 17:34
A plugin to hide the minimap using a setting on sublime text.
# -*- encoding: utf-8 -*-
import sublime
import sublime_plugin
class MinimapSetting(sublime_plugin.EventListener):
def on_activated(self, view):
show_minimap = view.settings().get('show_minimap')
if show_minimap:
@math2001
math2001 / demos.md
Last active October 27, 2020 07:16
demos

I wanted to learn how to do isometric rendering:

isometry

And I wanted to learn about A* (how do you get out of a maze, quickly)

maze-iso

I wanted to learn how to make multiplayer games (running over TCP):

Can a function z = f(x, y) have an inverse (x, y, z in R)

Surface points with distinct heights

If we think of z = F(x, y) as describing a surface, then this question translates to asking:

Can one find a continuous surface for which every distinct point on that surface has a unique height

with(LinearAlgebra)
a := <vector A>
b := <vector B>
solve(Equate(a, b))

Keybase proof

I hereby claim:

  • I am math2001 on github.
  • I am math2001 (https://keybase.io/math2001) on keybase.
  • I have a public key ASCzjxjUj_-ujbKB9g5mjtFSR3vYtbkUTpa1GYbcV1AWJQo

To claim this, I am signing this object:

@math2001
math2001 / oop.py
Created September 23, 2018 06:42
Oriented object programmation explained
# We are going to use an analogy of building houses to understand OOP.
# A class is like the plan/design of the house. It's the theory, nothing concrete.
# Our house has different properties (such as the colour, the number of doors, etc), these are called attributes.
# Our house has different behaviours (such as starting the alarm, locking every doors, etc), these are called methods.
# An instance, however, is the real thing. From one plan, one design, one *class*, we can make as many actual houses as we like
# And we can change them. For example, one house (an instance), might have 2 doors, where as an other one might have 4 doors.
# But they still have the same plan
@math2001
math2001 / Python Syntax Conventions.md
Last active September 22, 2018 09:24
Conventions for your Python code so that it looks beautiful 🎉

This gist simply lists some of the PEP8 conventions.

What is that? Simply some "rules" that you're not obliged to respect, but improves the visual quality of your python code. Because:

Readability counts.

So, let's get started.

@math2001
math2001 / pinglan
Created July 7, 2018 09:00
Ping every ip on the local network
#! /usr/bin/sh
trap 'exit' SIGINT
for i in `seq 254`; do
(ping 192.168.1.$i -c 1 -w 1 > /dev/null && echo 192.168.1.$i)&
done
wait
@math2001
math2001 / Usage.md
Created April 26, 2018 02:35
Possibly the simplest version of a chat server made with Python

You can build a client in Python if you feel like it, but you might as well just use telnet:

$ telnet localhost 9877