Skip to content

Instantly share code, notes, and snippets.

Avatar

AbdealiJK AbdealiJK

  • Corridor Platforms
  • Chennai
View GitHub Profile
@AbdealiJK
AbdealiJK / pyjava.py
Created Jul 21, 2020
Comparing py-java libraries
View pyjava.py
# 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'
@AbdealiJK
AbdealiJK / python-workflow.yml
Created Oct 14, 2019
Caching with Github Actions + S3
View python-workflow.yml
name: Python Tests
jobs:
build:
runs-on: ubuntu-18.04
strategy:
max-parallel: 2
matrix:
python-version: [3.5, 3.6, 3.7]
@AbdealiJK
AbdealiJK / 00 - Intro to Jupyter.ipynb
Created Sep 24, 2016
WIkimedia Hackathon - Bits Pilani Hyderabad Campus
View 00 - Intro to Jupyter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AbdealiJK
AbdealiJK / spark_to_1csv.py
Created Oct 30, 2019
Writing Spark DataFrame to file
View spark_to_1csv.py
# 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
@AbdealiJK
AbdealiJK / delete-slack-messages.js
Last active Jul 28, 2019 — forked from firatkucuk/delete-slack-messages.js
Deletes slack public/private channel and chat messages.
View delete-slack-messages.js
#!/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 #######################################################################################################
View d3-3.3.6.js
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);
};
@AbdealiJK
AbdealiJK / file_metadata_bot.py
Last active Jun 23, 2016
A bot made with pywikibot and file-metadata
View file_metadata_bot.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, unicode_literals,
print_function)
import datetime
import os
import sys