Skip to content

Instantly share code, notes, and snippets.

@ZabihollahNamazi
ZabihollahNamazi / gist:ed160e066bc88a336f50960b1b001500
Created April 16, 2024 13:12
python code to automatically sign in to LinkedIn and apply for a job using selemium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
account_email = "*********"
account_password = "*********"
edge_option = webdriver.EdgeOptions()
edge_option.add_experimental_option("detach", value=True)
@espresso3389
espresso3389 / wsl2-rootless-docker.md
Last active April 16, 2024 13:30
WSL2 configuration for developing using rootless docker

NOTE: WORK IN PROGRESS

WSL2 configuration for developing using rootless docker

This document assumes Windows Insider Preview Dev.

Install Ubuntu 22.04

Installing Ubuntu 22.04.1 LTS from Microsoft Store.

@bw2012
bw2012 / http_download.cpp
Created April 6, 2019 19:41
C++ http download file
#include <iostream>
#include <stdio.h>
#include <sys/socket.h>
//#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
//#include <unistd.h>
@sdawood
sdawood / remove-all-youtube-liked-videos.js
Last active April 16, 2024 13:20
How to remove (unlike) all liked videos on youtube, June, 2023
/*
* inspired by https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f
* modified to remove all liked Youtube videos and to work with Youtube as of June 2023
*/
setInterval(function () {
videos = document.getElementsByTagName('ytd-playlist-video-renderer');
// when a video is removed, the tag gets an 'is-dimissed' attribute, which tripped the original script
var notDismissedIndex = 0;
@McKabue
McKabue / ERROR.js
Last active April 16, 2024 13:20
Handling JavaScript Errors Like a boss by logging them to the server and possibly returning a behavior. WE THEN MAKE A REQUEST TO YOUR SERVERS AS IF YOU ARE LOADING A JAVASCRIPT FILE. THE URL WILL CONTAIN THE QUERY PARAMETERS THAT YOU WANT TO PASS TWO THE SERVER. THIS METHOD HAS TO ADVANTAGES: 1. THE CODE FOR SENDING THE REQUEST IS SIMPLE AS WE …
//https://developer.mozilla.org/en/docs/Web/API/GlobalEventHandlers/onerror
//https://blog.sentry.io/2016/01/04/client-javascript-reporting-window-onerror.html
//https://danlimerick.wordpress.com/2014/01/18/how-to-catch-javascript-errors-with-window-onerror-even-on-chrome-and-firefox/
window.onerror = function (messageOrEvent, source, lineno, colno, error) {
try {
console.log({
//error message(string).Available as event (sic!) in HTML onerror = "" handler.
messageOrEvent: messageOrEvent,
//URL of the script where the error was raised(string)
@Slach
Slach / backup-cronjob.yaml
Created April 16, 2024 13:17
clickhouse-backup CronJob examples
apiVersion: batch/v1
kind: CronJob
metadata:
name: clickhouse-backup-cron
spec:
# every day at 00:00
# schedule: "0 0 * * *"
schedule: "* * * * *"
concurrencyPolicy: "Forbid"
jobTemplate:
@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active April 16, 2024 13:18
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 16, 2024 13:18
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@vivekkr12
vivekkr12 / BouncyCastleCertificateGenerator.java
Last active April 16, 2024 13:17
Generate root X509Certificate, Sign a Certificate from the root certificate by generating a CSR (Certificate Signing Request) and save the certificates to a keystore using BouncyCastle 1.5x
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.BasicConstraints;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.KeyUsage;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
@darrarski
darrarski / FormattedTextField.swift
Last active April 16, 2024 13:14
SwiftUI FormattedTextField - TextField with custom display/edit formatters
import SwiftUI
public struct FormattedTextField<Formatter: TextFieldFormatter>: View {
public init(_ title: String,
value: Binding<Formatter.Value>,
formatter: Formatter) {
self.title = title
self.value = value
self.formatter = formatter
}