Skip to content

Instantly share code, notes, and snippets.

View tecoholic's full-sized avatar

Arunmozhi tecoholic

View GitHub Profile
@tecoholic
tecoholic / custom.css
Created April 26, 2023 05:22
Misskey Custom Styles
footer {
margin-top: 1rem;
}
header {
margin-bottom: 1rem;
}
/*
* Renote top decoration
*/
"""
This entire file is from ChatGPT generated code.
Here are the list of prompts that led to this output:
1. Create a Django model to record bank transactions from a personal bank
account
2. add currency, foreign currency related fields to the model to handle
international transactions
3. Create an account model to hold the bank account information and update
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 11 columns, instead of 4 in line 6.
COLLEGE CODE,COLLEGE NAME,BRANCH CODE,BRANCH NAME,OC,BC,BCM,MBC,SC,SCA,ST
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",BY,BIO MEDICAL ENGINEERING (SS),0,0,0,0,0,2,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CE,CIVIL ENGINEERING,0,0,0,0,3,2,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CM,COMPUTER SCIENCE AND ENGINEERING (SS),0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CS,COMPUTER SCIENCE AND ENGINEERING,0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",EC,ELECTRONICS AND COMMUNICATION ENGINEERING,0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",EE,ELECTRICAL AND ELECTRONICS EN
@tecoholic
tecoholic / 01-11-2020.txt
Last active November 25, 2020 04:31
CovidBulletinExtractor.ipynb
COVID-19 Positive Deaths without comorbidities – Total: 2
Death in Private health facilities without comorbidities
Death Case No. 11133
A 58 Years old Male from Vellore having COVID-19 RTPCR Positivity on
29.10.2020 admitted on 18.10.2020 at 09.32 AM in a private medical college
and hospital, Vellore with Complaints of Fever, Cough for 5 days and
Difficulty in Breathing for 2 days died on 29.10.2020 at 04.30 AM due to
ARDS / COVID-19 Pneumonia.
Death in Government health facilities (DMS) without comorbidities
Death Case No. 11134
@tecoholic
tecoholic / category.js
Created August 11, 2020 15:20
Strapi Controller file implementing the IsOwner Policy
'use strict';
const { parseMultipartData, sanitizeEntity } = require("strapi-utils");
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/
module.exports = {
@tecoholic
tecoholic / index.html
Last active April 1, 2020 09:06
D3 example with Covid API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3.js Example</title>
<style>
.axis text {
font: 8px sans-serif;
}
/* This is the small lines in the axis */
@tecoholic
tecoholic / lamda_function.py
Last active November 12, 2019 08:40
Post Nifty movers to Mastodon
"""A Mastodon bot that collects the Nifty data and creates a post"""
import json
import urllib.request
import urllib.parse
import os
from datetime import datetime
@tecoholic
tecoholic / app.py
Last active August 16, 2019 06:04
Example code for the post "Parsing & Validating JSON in Flask Requests"
from flask import Flask, request, jsonify
from functools import wraps
app = Flask(__name__)
users = []
def required_params(required):
def decorator(fn):
@tecoholic
tecoholic / wireshark_http_extractor.py
Created February 6, 2019 07:56
Extract the flow of requests and responses from a Wireshark dump JSON exported file
import sys
import json
from urllib.parse import urlparse, parse_qs
def parse_multimap(ordered_pairs):
"""JSON loads object_pairs_hook, which creates a list of values when
duplicate keys are found in the JSON file being parsed
@tecoholic
tecoholic / process.py
Last active October 6, 2023 10:48
Python script to replace an image file in the PDF
import sys
import os
from PIL import Image
# Include the \n to ensure extact match and avoid partials from 111, 211...
OBJECT_ID = "\n11 0 obj"
def replace_image(filepath, new_image):