Skip to content

Instantly share code, notes, and snippets.

View coolharsh55's full-sized avatar

Harshvardhan Pandit coolharsh55

View GitHub Profile
# .github/workflows/example.yml
# https://stackoverflow.com/questions/23793062/can-forks-be-synced-automatically-in-github
name: Merge upstream branches
on:
schedule:
# actually, ~5 minutes is the highest
# effective frequency you will get
- cron: '0 * * * *'
jobs:
@coolharsh55
coolharsh55 / dpv-skos-minimal-integrity-check.ttl
Created January 22, 2022 15:55
A minimal RDF graph to check consistency and integrity of providing DPV as a SKOS + OWL vocabulary
@prefix ex: <http://example.com/ex#> .
@prefix dpv: <http://example.com/dpv#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@base <http://example.com/dpv-skos#> .
@coolharsh55
coolharsh55 / consent-ontology.ttl
Created September 4, 2020 17:33
Earlier iteration of GConsent - shown for demonstration purpose only
@coolharsh55
coolharsh55 / twitter-pin.css
Last active March 10, 2021 11:38
Replaces Twitter heart 'like' symbols with pin emoji (📌) as 'save' symbol.
/* remove heart on main view and replace with pin */
div.css-1dbjc4n.r-18u37iz.r-1wtj0ep.r-1s2bzr4.r-1mdbhws > div:nth-child(3) > div:first-child > div:first-child > div:nth-child(1) {
visibility: hidden;
}
div.css-1dbjc4n.r-18u37iz.r-1wtj0ep.r-1s2bzr4.r-1mdbhws > div:nth-child(3) > div:first-child > div:after {
content: "📌";
color: transparent;
text-shadow: 0 0 0 #8899a6;
}
@coolharsh55
coolharsh55 / identity-broken-links.js
Created July 22, 2019 21:18
identify broken internal links on a page
@coolharsh55
coolharsh55 / printjob_status.sh
Last active September 25, 2017 19:17
printer_job_status
#!/usr/bin/env bash
# author Harshvardhan Pandit
# how this works:
# using snmpwalk, the jobstring status is retrieved for the printer using the
# query (found using Lexmark MIB)
# by default, NOJOBRESPONSE is returned.
# If this is not the response, then that means that something is being printed.
# The jobstring contains the IP address of the job (who send that job).
@coolharsh55
coolharsh55 / walton_club_car.ino
Last active April 14, 2017 06:23
Arduino code for Walton Club Easter Camp car challenge
/**
__ __ _ _______ ____ _ _ _____ _ _ _ ____
\ \ / /\ | | |__ __/ __ \| \ | | / ____| | | | | | _ \
\ \ /\ / / \ | | | | | | | | \| | | | | | | | | | |_) |
\ \/ \/ / /\ \ | | | | | | | | . ` | | | | | | | | | _ <
\ /\ / ____ \| |____| | | |__| | |\ | | |____| |___| |__| | |_) |
\/ \/_/ \_\______|_| \____/|_| \_| \_____|______\____/|____/
ROBOT CAR CODE
$> touch ~/.ssh/config
//Contents:
Host <convenient_name>
Hostname <ip_address_or_url>
IdentityFile <~/.ssh/pem_key_file>
User <name_of_user>
Host ... [repeat for each ssh config]
@coolharsh55
coolharsh55 / gist:6febedc6069137938829
Created January 27, 2016 10:20
MySQL access denied / plugin not loaded error
// login as root
mysql -uroot -p
// select mysql internal database
select mysql;
// delete relevant user
drop user 'username'@'host';
// create user again
@coolharsh55
coolharsh55 / convert_16bits.py
Last active July 12, 2022 08:00
Convert int to 16 bits in python
# using struct
# the 'H' stands for unsigned 2-byte 16bit number
# use 'h' for signed 2-byte 16bit number
# further reference available in python.struct docs
import struct
m16 = lambda x: struct.unpack('H', struct.pack('H', x))[0]
# using bitwise AND
# just AND it with 0XFFFF (max 16-bit value)