Skip to content

Instantly share code, notes, and snippets.

View alarsyo's full-sized avatar
🧑‍💻
tinkering

Antoine Martin alarsyo

🧑‍💻
tinkering
View GitHub Profile
func resolveCustomAddress (c txtdirect.Config) {
net := net.Resolver {
PreferGo: true,
Dial: func (ctx context.Context, network, address string) (Conn, err) {
d := net.Dialer{}
return d.DialContext(ctx, network, c.Resolver)
},
}
txts := net.LookupTXT("example.com")
@alarsyo
alarsyo / keybase.md
Created June 10, 2018 11:45
keybase.md

Keybase proof

I hereby claim:

  • I am alarsyo on github.
  • I am alarsyo (https://keybase.io/alarsyo) on keybase.
  • I have a public key whose fingerprint is CE39 BD20 84F8 9C30 FFC5 1AFA F2DF 1376 B646 B278

To claim this, I am signing this object:

@alarsyo
alarsyo / .vimrc
Last active February 16, 2017 16:01
vimrc
" Disable backup files ending in ~
set nobackup
" UTF8
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Use indentation of previous line
set autoindent
@alarsyo
alarsyo / README.md
Last active February 16, 2017 15:47
epi3 Setup

Installation :

Il suffit de copier ces 3 fichiers dans le repertoire ~/.config/i3/ de ta session.

Clique sur "Download zip" en haut a droite de cette page, puis :

[login_x@ ~] cd Downloads
[login_x@ ~/Downloads] unzip monfichier.zip
[login_x@ ~/Downloads] mv monfichier/* ~/.config/i3/
@alarsyo
alarsyo / solution.sh
Last active February 7, 2017 18:23
TP1 THLR
#!/bin/sh
# EX 1
perl -0777 -pe 's/{.*}/COMMENTAIRE/gsm' exo1/q1
perl -0777 -pe 's/{[^}]*}/COMMENTAIRE/gsm' exo1/q2
# EX 2
perl -0777 -pe 's/"[^"]*"/CHAINE/gsm' exo2/q1
perl -0777 -pe 's/"([^"\\]|\\.)*"/CHAINE/gsm' exo2/q2
@alarsyo
alarsyo / matrix.py
Created December 23, 2016 22:08
Matrix rotation
def rotateMatrix(matrix):
newMatrix = []
l = len(matrix)
for i in range(l):
newMatrix.append([])
for j in range(l):
newMatrix[i].append(matrix[l - 1 - j][i])
return newMatrix
@alarsyo
alarsyo / td5.py
Last active September 22, 2016 19:45
### Correction des fonctions du lundi 19/09 ###
def print_mat(M, d):
s = "| {:" + str(d) + "d}"
l = len(M[0])
t = '-' * (d+3) * l + '-'
for i in range(len(M)):
print(t)
for j in range(l):
print(s.format(M[i][j]), end=' ')
false || (1/0 = 0);;
true || (1/0 = 0);;
false && (1/0 = 0);;
true && (1/0 = 0);;
'Z' < 'a';;
"A long sentence to see how string comparisons work" > "a little one";;
(* to see how functions with several parameters work *)
@alarsyo
alarsyo / list9.py
Last active May 12, 2016 13:53
List 9 python
def checkValidlist9AB(n):
a = n // 10
b = n % 10
return (a != b)
def checkValidlist9(n):
return (n > 9 and n < 100)
@alarsyo
alarsyo / perfect.py
Created May 11, 2016 13:35
Perfect number
def sumDivs(n,accu, i):
if i > (n//2):
return accu
elif n % i == 0:
print(i)
return sumDivs (n, accu + i , i+1)
else :
return sumDivs (n, accu, i+1)