Skip to content

Instantly share code, notes, and snippets.

View funilrys's full-sized avatar
🐱
Hi, you are awesome!

Nissar Chababy funilrys

🐱
Hi, you are awesome!
View GitHub Profile
@funilrys
funilrys / protect_matrix_room.py
Last active August 1, 2022 15:32
A quick and dirty way to protect a matrix room against phishing by adding all possible variants of the room name as the room aliases.
"""
protect_matrix_room - A quick and dirty way to protect a matrix room against phishing.
What does it do?
Protects a matrix room against phishing by adding an alias to the room.
The alias is the room name, but in all possible variants.
NOTE: We Only change the between the last point (`.`) and
the first double point `:`.
@funilrys
funilrys / README.md
Last active July 14, 2019 10:29
Convert AdBlock - filter list - formated file into hosts file using PyFunceble.

Note

This is a quick and dirty solution for StevenBlack/hosts#1012. Let me know if you want it as a PyPi package from it.

Requirements

$ pip3 install --user PyFunceble
@funilrys
funilrys / python_pymysql_notes.md
Created May 30, 2019 11:33 — forked from simonrw/python_pymysql_notes.md
Notes about pymysql connections

Database transactions

pymysql

  • Defaults to autocommit=False
connection = pymysql.connect(user='user', db='test')
cursor = connection.cursor()
cursor.execute('insert into test (value) values (10)')

Keybase proof

I hereby claim:

  • I am funilrys on github.
  • I am funilrys (https://keybase.io/funilrys) on keybase.
  • I have a public key ASByvNOP3_iC21AcQllSRSx-RYgAJr36SV4HCG7tcUforwo

To claim this, I am signing this object:

@funilrys
funilrys / happy_numbers.py
Last active April 8, 2018 09:49
This module helps to find out if a number is happy or unhappy. More notes about each function at: https://funilrys.com/programming/python/happy-numbers
#!/usr/bin/env python3
"""
This module helps to find out if a number is happy or unhappy.
"""
def given_number():
"""
This function ask the user for a number and return it so it can be
usable by other functions.
@funilrys
funilrys / random-background.js
Created April 4, 2017 16:21
How to change background randomly
/**
* Return a list of URL
* @returns {array}
*/
function backgrounds() {
// We create a variable
var imageURLs = [
// We assign in an array the list of URL/filename we want as background
"https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-301322.jpg",
"https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-103541.jpg",