Skip to content

Instantly share code, notes, and snippets.

View AbdealiLoKo's full-sized avatar

AbdealiLoKo AbdealiLoKo

  • Corridor Platforms
  • Bengaluru
View GitHub Profile
@AbdealiLoKo
AbdealiLoKo / file_metadata_bot.py
Last active June 23, 2016 22:46
A bot made with pywikibot and file-metadata
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, unicode_literals,
print_function)
import datetime
import os
import sys
@AbdealiLoKo
AbdealiLoKo / 00 - Intro to Jupyter.ipynb
Created September 24, 2016 10:24
WIkimedia Hackathon - Bits Pilani Hyderabad Campus
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AbdealiLoKo
AbdealiLoKo / d3-3.3.6.js
Created July 6, 2018 04:37
Dagre-D3 files
d3 = function() {
var d3 = {
version: "3.3.6"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
@AbdealiLoKo
AbdealiLoKo / delete-slack-messages.js
Last active July 28, 2019 13:30 — forked from firatkucuk/delete-slack-messages.js
Deletes slack public/private channel and chat messages.
#!/usr/bin/env node
// To get stats on all channels, call:
// node ./delete-slack-messages.js
// To delete messages for a particular channel, get the Channel ID and pass as a param:
// node ./delete-slack-messages.js CHANNEL_ID
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// CONFIGURATION #######################################################################################################
@AbdealiLoKo
AbdealiLoKo / python-workflow.yml
Created October 14, 2019 10:57
Caching with Github Actions + S3
name: Python Tests
jobs:
build:
runs-on: ubuntu-18.04
strategy:
max-parallel: 2
matrix:
python-version: [3.5, 3.6, 3.7]
@AbdealiLoKo
AbdealiLoKo / spark_to_1csv.py
Created October 30, 2019 17:44
Writing Spark DataFrame to file
# Write a spark DataFrame into a single CSV files (to open with Excel/other tools easily)
# Save the file to S3
import s3fs
import pyspark.sql.functions as F # noqa: N812
def spark_to_csv(spark_df, out_path):
"""
Save the file in part files with spark and then append them together
@AbdealiLoKo
AbdealiLoKo / pyjava.py
Created July 21, 2020 19:33
Comparing py-java libraries
# Example:
# PYJAVA_LIB=jpype venv/bin/python pyjava.py
import os
from datetime import datetime
from jpmml_evaluator import _package_classpath
lib = os.environ.get('PYJAVA_LIB')
assert lib is not None, 'Set env var PYJAVA_LIB to py4j/jnius/jpype'
@AbdealiLoKo
AbdealiLoKo / better-commits.md
Last active May 18, 2022 07:54
Better commit messages (message creators and linters)

Better commit messages

The 3 common ways for developers to document information about their work is:

  1. Comments
    • When is this written: When the developer wants something to be clearly and immediately visible to all other developers
    • When is this found: As soon as other developers are reading code, they will find these comments
  2. Commit messages
    • When is this written: When the developer wants to explain the work involved in them making a change. Why a change was made, explanation of the
    • When is this found: When other developers dig a big deeper on why or when a change was made - they will find these commit messages
  3. Tech Documentation
@AbdealiLoKo
AbdealiLoKo / README-sqlalchemy-query-relationsihps.md
Last active June 20, 2022 05:45
Usecase: Speedup SQLAlchemy queries
@AbdealiLoKo
AbdealiLoKo / playwright-demo.ipynb
Last active August 19, 2023 19:46
Playwright Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.