Skip to content

Instantly share code, notes, and snippets.

View epireve's full-sized avatar
🎯
Focusing on things that matter

Firdaus Adib epireve

🎯
Focusing on things that matter
  • Invoture Inc.
  • Liverpool, United Kingdom
View GitHub Profile
import csv
import json
import logging
# Set up logging
logging.basicConfig(filename='processing.log', level=logging.INFO)
# Define the JSON file path
json_file = 'input.json'
https://nfs.faireconomy.media/ff_calendar_thisweek.xml
@epireve
epireve / keygen.js
Created August 10, 2022 15:53
Generate 16 alphanumerics license JS
function generatelicense() {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
var charactersLength = characters.length;
for (var i = 0; i < 16; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
if (i === 3 || i === 7 || i === 11) {
result += '-';
}
}
@epireve
epireve / Malaysia.geojson
Last active April 6, 2022 04:42
Deleted redundant geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@epireve
epireve / coffee_chatbot.py
Last active May 15, 2020 03:54
Dummy Coffee Chatbot. Chatbot Evolution and Dialog Trees
# Define your functions
def coffee_bot():
print("Welcome to the cafe!")
size = get_size()
print(size)
drink_type = get_drink_type()
print(drink_type)
print('Alright, that\'s a {} {}!'.format(size, drink_type))
@epireve
epireve / max_num.py
Created May 15, 2020 03:25
A function called max_num() that has three parameters named num1, num2, and num3. The function should return the largest of these three numbers. If any of two numbers tie as the largest, you should return "It's a tie!".
# Write your max_num function here:
def max_num(num1, num2, num3):
# if (num1>num2) and (num1>num3) return num1
# if (num1>num2) and (num1>num3) return num1
list = [num1, num2, num3]
list.sort()
# print(list[0])
# print(list[1])
# print(list[2])
@epireve
epireve / gist:00518e23909a3d32c789111ec27c5c70
Created September 29, 2019 11:47
Securing/updating PhpMyAdmin
When you installed phpMyAdmin onto your server, it automatically created a database user called phpmyadmin which performs certain underlying processes for the program. Rather than logging in as this user with the administrative password you set during installation, it’s recommended that you log in as either your root MySQL user or as a user dedicated to managing databases through the phpMyAdmin interface.
Configuring Password Access for the MySQL Root Account
In Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket plugin by default rather than with a password. This allows for some greater security and usability in many cases, but it can also complicate things when you need to allow an external program — like phpMyAdmin — to access the user.
In order to log in to phpMyAdmin as your root MySQL user, you will need to switch its authentication method from auth_socket to mysql_native_password if you haven’t already done so. To do this, open up th
@epireve
epireve / gist:f6b21cdb90bec9f1b499f9389597ae98
Created May 7, 2019 06:09
Mount Gdrive in Google Colab nb
import os
from google.colab import drive
drive.mount('/content/drive', force_remount=True)
# os.remove('/content/inv-tf')
os.symlink('/content/drive/Team Drives/Inv-tf', '/content/inv-tf')
print("symlink created")
!ls -l /content/inv-tf
root_dir = "/content/inv-tf/"
# Please note that latest src is The Kali Rolling Repository. Refer for new update : http://docs.kali.org/general-use/kali-linux-sources-list-repositories
# According to the Kali Linux Official Documentation, the sources.list file should contain the following line(s):
deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
@epireve
epireve / css_resources.md
Last active August 29, 2015 14:12 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides