Skip to content

Instantly share code, notes, and snippets.

@jitsejan
jitsejan / index.html
Created September 1, 2017 08:44
Font Awesome select boxes
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="script.js"></script>
<link rel="stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
@jitsejan
jitsejan / data.csv
Created September 1, 2017 08:47
Sequence diagram
_time sender receiver message
2017-05-12 01:00 Mario World 1 Start world 1
2017-05-12 01:30 Mario World 1-1 Move to World 1-1
2017-05-12 02:00 World 1-1 Mario Received Mushroom
2017-05-12 02:30 Mario World 1-2 Move to World 1-2
2017-05-12 03:00 World 1-2 Mario Received Fire flower
2017-05-12 03:30 Mario World 1-3 Move to World 1-3
2017-05-12 04:00 World 1-3 Mario Received Warp Whistle
2017-05-12 04:30 Mario World 1-4 Move to World 1-4
2017-05-12 05:00 World 1-4 Mario Received One-up
@jitsejan
jitsejan / data.json
Created September 1, 2017 08:48
Grouped bar chart
[
{
"Date": "2017-04-28",
"DRK": "0.01136728",
"BTC": 0,
"LTC": 0
},
{
"Date": "2017-04-29",
"DRK": "0.01008568",
@jitsejan
jitsejan / data.json
Created September 1, 2017 08:50
Multi line chart
[
{
"Time": "2017-05-03 23:17",
"BTC": 19.7,
"DOGE": 0,
"ETH": 78.88,
"LTC": 20.81,
"REP": 0
},
{
[{"name":"3M Canada Company","Community Involvement":10,"Employee Engagement & Performance":7,"Financial Benefits & Compensation":9,"Health & Family-Friendly Benefits":9,"Physical Workplace":10,"Training & Skills Development":9,"Vacation & Personal Time-Off":6,"Work Atmosphere & Communications":10,"Total Score":70},{"name":"Aboriginal Peoples Television Network Inc. \/ APTN","Community Involvement":9,"Employee Engagement & Performance":6,"Financial Benefits & Compensation":7,"Health & Family-Friendly Benefits":9,"Physical Workplace":7,"Training & Skills Development":9,"Vacation & Personal Time-Off":9,"Work Atmosphere & Communications":9,"Total Score":65},{"name":"Accenture Inc.","Community Involvement":10,"Employee Engagement & Performance":9,"Financial Benefits & Compensation":7,"Health & Family-Friendly Benefits":9,"Physical Workplace":7,"Training & Skills Development":7,"Vacation & Personal Time-Off":6,"Work Atmosphere & Communications":9,"Total Score":64},{"name":"Agrium Inc.","Community Involvement":10,"
@jitsejan
jitsejan / retrieve.bash
Created May 28, 2018 02:52
Loop through the years, start a screen and call the Python script.
for ((i=1998;i<=2019;i++));
do
screen -dmS $i bash -c 'source activate my-env; python retrieval.py '$i'; exec bash'
done
version: '3.2'
services:
scraper:
build:
context: .
dockerfile: ./Dockerfile
command: scrapy crawl insolvencydirect
environment:
- HUB_PORT_4444_TCP_ADDR=hub
- HUB_PORT_4444_TCP_PORT=4444
@jitsejan
jitsejan / blobspark.py
Created February 26, 2019 12:38
Interacting with Blob storage (no Spark writing)
from azure.storage.blob import BlockBlobService
import pandas as pd
import pyarrow.parquet as pq
from io import BytesIO
from configparser import RawConfigParser
from pyspark import SparkConf, SparkContext, SQLContext
CONTAINER_NAME = "userjj"
BLOB_NAME = "characters.parquet"
@jitsejan
jitsejan / doughnut_plot.py
Created July 7, 2019 13:23
Create a dougnut plot with Matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.style as style
import seaborn as sns
plt.rcParams["figure.figsize"] = (12,12)
# Improve style of the plots
style.use('seaborn-deep')
style.use('ggplot')
@jitsejan
jitsejan / jira_extract.py
Created September 5, 2020 03:05
Jira lead time extraction
import pandas as pd
import requests
JIRA_TOKEN = "abcdefg12345"
JIRA_URL = "https://jitsejan.atlassian.net/"
JIRA_USER = "mail@jitsejan.com"
# Setup a requests session
rsession = requests.Session()
# New Jira instances authenticate through a token