Skip to content

Instantly share code, notes, and snippets.

View TunedMystic's full-sized avatar

Sandeep Jadoonanan TunedMystic

View GitHub Profile
@TunedMystic
TunedMystic / render_number.go
Created April 21, 2024 05:50 — forked from gorhill/render_number.go
A Go function to render a number to a string based on the following user-specified criteria: thousands separator, decimal separator, decimal precision. I didn't feel it was worth to publish a library just for this piece of code, hence the snippet. Feel free to reuse as you wish.
/*
Author: https://github.com/gorhill
Source: https://gist.github.com/gorhill/5285193
A Go function to render a number to a string based on
the following user-specified criteria:
* thousands separator
* decimal separator
@TunedMystic
TunedMystic / parse_domain.py
Last active October 4, 2022 00:16
Parse the domain name from a url.
from urllib.parse import urlparse
def parse_domain_name(url: str) -> str:
"""
Parse the domain name from the given url.
"""
return urlparse(url).hostname.split('.')[-2]
@TunedMystic
TunedMystic / links.md
Last active January 10, 2021 05:37
Hacker News: Successful one-person online businesses
@TunedMystic
TunedMystic / add-stylesheet.js
Created June 26, 2020 20:20
Add CSS styles to a webpage.
function addCss(rule) {
// https://stackoverflow.com/a/38063486
let css = document.createElement('style');
css.type = 'text/css';
if (css.styleSheet) {
css.styleSheet.cssText = rule; // Support for IE
}
else {
css.appendChild(document.createTextNode(rule)); // Support for the rest
}
@TunedMystic
TunedMystic / scanports.py
Created April 2, 2020 17:19
Scan some ports
import socket
import sys
def isOpen(ip, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((ip, int(port)))
s.shutdown(2)
return True
@TunedMystic
TunedMystic / allEventListeners.js
Created August 10, 2019 14:20
See all event listeners on the page.
// See all event listeners on the page.
// Ref: https://stackoverflow.com/a/45842339
//
Array.from(document.querySelectorAll('*'))
.reduce(function(pre, dom){
var evtObj = getEventListeners(dom)
Object.keys(evtObj).forEach(function (evt) {
if (typeof pre[evt] === 'undefined') {
pre[evt] = 0
}
@TunedMystic
TunedMystic / changefileperms.sh
Created June 3, 2019 03:47
Change File Permissions
alias changefileperms='find . -type d -perm 777 -exec chmod 755 {} \; && find . -type f -perm 777 -exec chmod 644 {} \;'
@TunedMystic
TunedMystic / gist:6d3a6f0cf1bbbdba3dd01f61ebf4ead4
Created May 26, 2019 16:46 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@TunedMystic
TunedMystic / README.md
Created May 9, 2019 23:47 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")

Keybase proof

I hereby claim:

  • I am tunedmystic on github.
  • I am tunedmystic (https://keybase.io/tunedmystic) on keybase.
  • I have a public key ASDbIS9b4_ZKsJfbYOT5zlVkjNctg8yLEPyqX4GtnWSfvAo

To claim this, I am signing this object: