Skip to content

Instantly share code, notes, and snippets.

View king-11's full-sized avatar

Lakshya Singh king-11

View GitHub Profile
king-11 /
Created August 23, 2021 08:07 — forked from krisleech/
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

king-11 / blocking_action.c
Created July 10, 2021 17:22
Qthread socket debugging
View blocking_action.c
#include <stdio.h> //printf
#include <string.h> //strcpy
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
king-11 /
Last active July 16, 2021 20:20
API Design for socket library

Socket Module API

To those familiar with the Unix socket API, the method names will feel familiar, though their usage will be somewhat simpler than the raw Unix socket API. The Module will comprise of four records which will abstract lower order functions to higher and more intutive methods for user:

  • ipAddr : Address information storage structure.
  • tcpConn : A TCP Socket with established connection
  • tcpListener : A TCP Socket listening for connections
  • udpSocket : A connection less UDP Socket

Address Information

king-11 /
Last active June 8, 2021 06:20
Comparing Socket Library of different languages

Socket Libraries

  • Julia
  • Go
  • Python


Julia uses two types of socket structs one is TCPServer other is TCPSocket similarly we also have UDPSocket

king-11 / laravel-ajax-form.js
Created June 24, 2020 09:00 — forked from mp035/laravel-ajax-form.js
Convert any standard HTML form to ajax by adding a few classes to the components and including this file. (see comments)
View laravel-ajax-form.js
// notes on using this file:
// This file is intended to work with a standard html form the same as what you use for server side rendered laravel projects.
// The only changes you need to make to the form are:
// 1. Add the class "ajax-submit" to any form you want to be submitted via ajax.
// 2. If you have a "Cancel" button on your form, mark it with the class "form-cancel"
// 3. Add a bootstrap alert in your form, marked with the class "ajax-error-alert" and "collapse" (to keep it initally hidden). This alert will display any error messages.
// Then call the function "AttachAjaxSubmit()" after the DOM is loaded.
// NOTE: This script requires bootstrap to style the components during the submission process.
king-11 / cloudSettings
Last active August 15, 2020 13:38
Visual Studio Code Settings Sync Gist
View cloudSettings