Skip to content

Instantly share code, notes, and snippets.

View Prajwalprakash3722's full-sized avatar
:atom:
Zen :)

Prajwal prakash Prajwalprakash3722

:atom:
Zen :)
View GitHub Profile
if err := ValidatePluginName("mysql"); err != nil {
log.Fatalf("Plugin is not valid: %v", err)
}
// Load the mysql, hello, and jobs plugins
err := LoadPlugins(manager, []string{"mysql", "hello", "jobs"})
// Register the "mysql" plugin with an alias "database"
GlobalRegistry.RegisterPlugin("mysql", NewMySQLPluginFactory, "database")
// This function is a factory.
func NewMySQLPluginFactory() types.Plugin {
return mysql_plugin.New()
}
package types
// Plugin is the fundamental interface for all extensible components.
type Plugin interface {
// Name provides a unique identifier for the plugin.
Name() string
// Configure applies a given configuration map to the plugin.
Configure(config map[string]interface{}) error
// Init initializes the plugin, like connecting to a database.
Init() error
@Prajwalprakash3722
Prajwalprakash3722 / netflix_history.go
Created September 14, 2023 20:47
Count the number of Series & Movies you have watched, Download the NetflixViewingHistory from your account/profile
package main
import (
"encoding/csv"
"fmt"
"os"
"regexp"
)
func main() {
@Prajwalprakash3722
Prajwalprakash3722 / VagrantFile
Last active August 7, 2023 16:35
2 ubuntu 22.04 os
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2204"
config.vm.network "private_network", type: "dhcp"
(1..2).each do |i|
config.vm.define "ubuntu#{i}" do |node|
node.vm.provider "libvirt" do |vb|
@Prajwalprakash3722
Prajwalprakash3722 / VagrantFile
Created August 5, 2023 08:14
Init VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
import java.util.Iterator;
class Node {
int value;
Node node;
}
public class Solution {
public static void main(String[] args) {
@Prajwalprakash3722
Prajwalprakash3722 / llvm-building.md
Last active July 27, 2023 15:09
llvm-building.md

Compiling LLVM from source is mandatory if you are developing an in-source pass (within LLVM source tree). For example, a debug build of LLVM is much more pleasant to work with compared to an optimized one. To compile LLVM, please follow the following steps:

  1. Download LLVM source and unpack it in a directory of your choice which will refer to as [LLVM_SRC]

  2. Create a Seperate Build folder in your choice of directory

$ mkdir llvm-build
$ cd llvm-build