Blog

  • go-socketify

    Go-Socketify

    A simple WebSocket framework for Go

    Install

    go get -u github.com/aliforever/go-socketify

    Usage

    A simple app that PONG when PING

    options := socketify.ServerOptions().SetAddress(":8080").SetEndpoint("/ws").IgnoreCheckOrigin()
    server := socketify.NewServer(options)
    go server.Listen()
    
    for connection := range server.Connections() {
        connection.HandleUpdate("PING", socketify.NewMapper[socketify.EmptyInput](func(_ socketify.EmptyInput) {
            connection.WriteUpdate("PONG", nil)
        }))
        go connection.ProcessUpdates()
    }

    Run the application and send below JSON to “ws://127.0.0.1:8080/ws”:

    {
      "type": "PING"
    }

    You’ll receive:

    {
      "type": "PONG"
    }

    Conventions

    Events are ought to be sent/received with following JSON format:

    {
      "type": "UpdateType",
      "data": {}
    }

    Type is going to be your update type and data is going to be anything.

    Storage

    You can retrieve clients within other clients by using Socketify’s client storage.

    You can enable the storage by setting option EnableStorage():

    options := socketify.Options().
    	SetAddress(":8080").
    	SetEndpoint("/ws").
    	IgnoreCheckOrigin().
    	EnableStorage() // <-- This LINE

    Each client has a unique ID set by shortid package, you can recall using client.ID().

    Clients are stored in a map with their unique ID and you can retrieve them by calling:

    client.Server().Storage().GetClientByID(UniqueID)

    Handlers

    You can specify a handler for an updateType to each client by using:

    client.HandleUpdate("UpdateType", func(message json.RawMessage) {
    	// Process message
    })

    This way Socketify will call your registered handler if it receives any updates with UpdateType specified.

    Or you can just listen on updates on your own:

    go client.ProcessUpdates()
    go func(c *socketify.Client) {
        for update := range c.Updates() {
            fmt.Println(update)
        }
    }(client)

    Note: You should always call go client.ProcessUpdates() to let a Socketify client receive updates.

    Docs:

    Checkout Docs Here

    Visit original content creator repository
    https://github.com/aliforever/go-socketify

  • gpvm

    GPVM

    The Gannet Parallel Virtual Machine (GPVM) is a virtual machine that is designed to execute natively on graphics processing units. Using OpenCL, it virtualises the Gannet System-on-Chip architecture to provide a functional approach to high-level GPGPU programming.

    Obtaining the Source Code

    The source code for the virtual machine is maintained using git and can be obtained by cloning the public Github
    repository located at:

    https://github.com/Garee/gpvm
    

    With git installed, enter the following command at a terminal to clone the repository in the current working
    directory:

    git clone https://github.com/Garee/gpvm.git
    

    Compiling the program

    A Makefile is supplied with the source code that can be used to build the program. An implementation of OpenCL
    must be installed for the program to compile. Please check your vendor for specific installation instructions.

    1. Build the program executable.
    make
    
    1. Removes object files but leaves the executable.
    make clean
    
    1. Removes all files produced from compilation.
    make distclean
    
    1. Runs the unit tests.
    make test
    

    Running the program

    Usage: ./vm [bytecode-file] [n-services]
    
    • bytecode-file – The file that contains the bytecode produced by the Gannet compiler.
    • n-services – The number of service nodes that the virtual machine should use.

    Running the example

    ./vm examples/4/test_ocl_gannet_4.tdc64 6
    

    The service configuration file is examples/OclGannet.yml.

    User Guide

    A user must complete the following steps to run a program within the virtual machine:

    1. Write a task description program.
    2. Implement the services used within this program.
    3. Configure these services.
    4. Compile the task description program and service configuration using the Gannet compiler to produce the
      input bytecode.
    5. Provide any input data and allocate memory for results.

    Service Implementations

    All services are implemented within the service compute function in the file kernels/VM.cl. To add a service,
    provide an additional case to the case statement using the associated service opcode and implement the service
    in the new block.

    Input/Output Data

    Inputs and outputs are handled by the data store. Implement the populateData(…) function that is located within
    src/UserData.cpp. Example implementations have been provided. You will likely be using the provided ptr and
    const services within your task description program to access your data.

    Important Files

    • src/VM.cpp – The host program, access your results here.
    • src/UserData.cpp – Contains the populateData(…) function which is used to populate the data store with
      input data.
    • kernels/VM.cl – The kernel program that implements the virtual machine. Contains the service implemen-
      tations in the service compute function.
    • include/SharedMacros.h – Contains configurable macros which may be used to tweak the system.
    • tests/vmtest.c – Contains all unit tests.

    Visit original content creator repository
    https://github.com/Garee/gpvm

  • cqrs-react-router

    cqrs-react-router

    cqrs-react-router is a library that will help you easily set up a CQRS/event sourcing system

    Build Status npm version

    typescript support

    cqrs-react-router is written in typescript and therefore will always support typescript

    how to contribute

    feel free to submit pull requests, just please provide clear notes as to what your update will change. Pull requests that cause tests to fail will not be accepted.

    how to install

    you will need npm. Then install this library with

    npm install cqrs-react-router
    

    cqrs

    to start writing your own typescript cqrs application, you will need an application service, to which you register command handlers and views

    import {ApplicationService, IAmACommandHandler, DomainService, IAmACommand, View, AggregateRoot} from "cqrs-react-router";
    
    class SomeView extends View{
        name = "SomeView"; // subscribers can get updates for this view
    
        stuff = 0;
    
        handle(event: IAmADomainEvent){
            var self = this;
            switch(event.name){
                case "SomeEvent":
                    self.stuff++;
                    return;
            }
        }
    }
    
    export class SomeAggregateRoot extends AggregateRoot{
        doStuff(command){
            //do something
        }
    
        applyEvent(event){
            switch(event.Name){
                //when action applied, do something here
                default:
                    return;
            }
        }
    }
    
    class SomeCommandHandler implements IAmACommandHandler{
    
        commandNames = ["SomeCommand"]; // this handler will handle commands with these names
    
        handle(command, domainService: DomainService, callback: () => void){
            domainService.getAggregateRoot(SomeAggregateRoot, (someAggregateRoot: SomeAggregateRoot) => {
                someAggregateRoot.doStuff(command);
            }, "someAggregateID");
        }
    }
    
    var appService = ApplicationService.Instance;
    
    appService.registerCommandHandler(SomeCommandHandler);
    appService.registerView(SomeView);

    To subscriber to a view

    appService.subscribe("SomeView", (view: SomeView) => {
        //do something with the new view;
    });

    To handle a command

    appService.handleCommand(new SomeCommand())

    To validate a command from views

    class TestCommandValidator extends CommandValidator{
    
        commandNames = [COMMAND_NAME];
    
        validate(command: IAmACommand){
            // getViewByName fetches view from application service
            this.getViewByName(viewName, (view: TestView)=> {
                if(view.hasSomeUnexpectedValue){
                    throw new DomainError("oh noes, I didn't expect that!");
                }
            });
        }
    }
    ApplicationService.Instance.registerCommandValidator(TestCommandValidator);

    router

    use just like react-router, only it will inject an application service that you can subscribe to.

    import {Router, Route, ApplicationService, Page} from "cqrs-react-router";
    
    class SomePage extends Page<any, any>{
        render(){
            return (
                <div>
                    Some stuff
                </div>
            )
        }
    }
    
    export class App extends React.Component<AppProps, AppState>{
        render(){
            return (
                <Router applicationService={new ApplicationService()}>
                    <Route path="https://github.com/" component={SomePage} />
                </Router>
            )
        }
    }

    replay events!

    testApplicationService.replayEvents();

    apply events from external sources

    testApplicationService.storeEvent(new TestEvent("123"));

    latest changes

    The latest changes can be found in the Wiki.

    Visit original content creator repository https://github.com/MichalPaszkiewicz/cqrs-react-router
  • File-Encryptions

    File Encryptions Tool

    This file encryption tool allows you to securely encrypt and decrypt various text file formats using a customizable security key. The encrypted output is generated with strong cryptographic practices, including the Advanced Encryption Standard (AES), hash functions, and random salt, ensuring robust security. After encrypting, the output file has the same name as the original file with an “.enc” extension. For example, if you encrypt hello.txt, the resulting encrypted file will be hello.txt.enc.

    How it’s work

    It sounds like you’re describing a file encryption tool that uses the Advanced Encryption Standard (AES) algorithm with additional security features like hash functions and random salt to enhance encryption strength. This kind of encryption tool is commonly used to secure sensitive information, ensuring that only those with the correct security key can access the decrypted contents.

    Installtions

    # clone repo
    $ git clone https://github.com/theNareshofficial/File-Encryptions.git
    
    # change directory
    $ cd File-Encryptions
    
    # Install requirements
    $ pip install -r requirements.txt
    
    # Encrypt the file
    $ python file-encryption.py --file hello.txt --mode encrypt --algorithm AES
    
    # Decrypt the file
    $ python file-encryption.py --file hello.txt.enc --mode decrypt --algorithm AES
    

    Help command

    # help command
    $ python file-encryption.py --help
    
    usage: file-encryptions [-h] --file FILE --mode {encrypt,decrypt} [--algorithm ALGORITHM]
    
    Encrypt or Decrypt a file with a specified algorithm and key.
    
    options:
      -h, --help            show this help message and exit
      --file FILE           Path to the file to encrypt or decrypt.
      --mode {encrypt,decrypt}
                            Whether to encrypt or decrypt.
      --algorithm ALGORITHM   
                            Encryption algorithm to use. Default AES.                                                                      
    

    Dockerfile Installation

    # Docker image build command
    $ docker build -t file-encryption.py
    
    # Docker Encrypt command
    $ docker run -t file-encryption.py --file hello.txt --mode encrypt --algorithm AES
    
    # Docker Decrypt command
    $ docker run -t file-encryption.py --file hello.txt.enc --mode decrypt --algorithm AES
    

    Tested OS

    • Windows
    • Linux
    • MAC

    Key Concepts

    • AES Algorithm: AES (Advanced Encryption Standard) is a symmetric encryption algorithm that is widely used for securing data. It offers strong security and is commonly used in various applications, including file encryption tools.

    • Symmetric Encryption: This type of encryption uses the same key for both encryption and decryption. The security of the encrypted data depends on keeping this key secret.

    • Hash Functions: A hash function takes an input and produces a fixed-size output (the hash). While hash functions are not inherently designed for encryption, they are often used to create message authentication codes or derive keys.

    • Random Salt: Salt is random data added to a cryptographic process to make it more resistant to attacks like brute-force or dictionary attacks. It ensures that even if the same data is encrypted multiple times, the resulting encrypted outputs are different.

    ThankYou🎉

    Visit original content creator repository https://github.com/theNareshofficial/File-Encryptions
  • php-ingress-statistics

    php-ingress-statistics

    ==================

    Class shows graphycal year statistics for Ingress from CSV file See demo: http://ingress.ge/stats/2014

    Sponsors

    No sponsors yet.. 🙁 If you like the software, don’t forget to donate to further development of it!

    PayPal donate button

    Usage:

    First you must create CSV file from Ingress data (You can create Excel and after export in CSV). Look at file example.csv

    CSV format is very simple: each cycle in each line: CYCLE_NAME,ENL_MU(k),RES_MU(k),ENL_TOP_PLAYER,RES_TOP_PLAYER

    Small example: 2014.03,59.4,16.2,LONGMAN [L14],bizarre [L10]

    If no data about any player you can left empty: 2014.03,59.4,16.2,,bizarre [L10]

    If MUs is under 1k you must specify amount with decimals under 1: 2014.03,0.1,16.2,LONGMAN [L14],bizarre [L10]

    	// include lib file
    	require('ingress.inc.php');
    
    	try {
    
    		// Possible parameters
    		// year - Statistics year for titles
    		// cell - Cell code
    		// cellname - Human readable cell name
    		// analytics - Google analytics id (if you want track page views)
    
    		// chart_options - Chart Options:
    		//			 animation.duration - Duration in milliseconds (default is 1500)
    		//			 animation.easing - Easing (default is 'swing'. More easings you can see at http://api.jqueryui.com/easings)
    		$chart_options = array('animation.duration'=>1500, 'animation.easing'=>'easeOutBounce');
    
    
    		// initialize class with custom parameters
    		$ingress = new Ingress(array('year'=>2014, 'cell'=>'NR02-BRAVO-02', 'cellname'=>'Tbilisi - Georgia'));
    
    		// load csv file
    		$ingress->loadCSV('example.csv');
    
    		// render generated HTML
    		$ingress->render();
    	}
    	catch(Exception $e) {
    		die($e->getMessage());
    	}

    TODO

    Add other languages

    Pull requests are welcome.

    Troubleshooting

    If you like living on the edge, please report any bugs you find on the php-ingress-statistics issues page.

    Visit original content creator repository https://github.com/akalongman/php-ingress-statistics
  • jarvil

    J.A.R.V.I.L. – Just A Rather Very Intelligent Library

    Introduction

    J.A.R.V.I.L. is a project of the “Smart Cities & IoT” course at the University of Stuttgart. It’s main goal is to simplify and automate various tasks in a modern library to make daily work easier for students.

    Services Configuration & Run

    Arduino Configuration

    StandartFirmata_Bluetooth allows building arduino code from remote devices via Bluetooth connection, using pyFirmata.
    StandartFirmata building arduino code from remote devices via USB, using pyFirmata.

    To configure a new arduino device, please build the StandartFirmata_Bluetooth.ino or StandartFirmata.ino via Arduino IDE USB connection

    System Setup Instructions

    To setup the system one needs to start the containers in each pi folder, under jarvil\docker, on their respective Raspberry Pi’s. In order to run a container one must run “docker-compose up -d” in its directory. Each container contains the following:

    1. The development container contains all services for live development.

    2. The pi-1 container contains mqtt broker and analysis services.

    3. The pi-2 container contains time slot booking services.

    4. The pi-3 container contains mqtt endpoint services.

    MQTT Broker – Mosquitto

    The system uses Mosquitto, a mqtt broker, to communicate between system components, ensuring indirect communication. The mqtt broker is connected to port 1883, so if one were to connect a mqtt spy it should also be connected to port 1883. The mqtt spy used for testing was MQTT-Explorer: https://github.com/thomasnordquist/MQTT-Explorer/.

    Database – Influxdb

    The system uses Influxdb as a database to store all data aquired by the system and that is then used by the system to make decisions. Influxdb is a time series database. The database is connected to port 8086 and can be accessed at http://localhost:8086/. The default login and password is “grafana” and “password” respectively.

    Time Slot Booking Service

    In order to visit the library one must book a time slot on the booking interface. The booking interface is accessible at http://localhost:5000/. When booking a slot one must select at least one 6 hour slot and fill your first name, last name and email adress and submit your reservation. First and last names have a minimum of 2 characters.

    The time slot on the booking interface’s data is cached on Redis. Redis can be accessed on http://localhost:6379/ and the cache can be viewed there.

    Full Documentation

    See the Wiki for full documentation and other information.

    Visit original content creator repository
    https://github.com/mario-ruoff/jarvil

  • JPG-Tools

    JPG-Tools 1.0.0

    A set of tools to manipulate images of popular formats using the powerful ImageMagick API.

    Python version

    2.7

    Language

    Chinese

    Supported OS

    Windows XP and above

    Below tools are integrated

    ImageMagick ImageMagick v6.8.9 (32 bit)

    Ghostscript 8.63 (32 bit)

    Screenshot

    N|Solid

    Features

    1. Use as image viewer
    2. A shortcut can be added to Windows Explorer’s Context Menu, then view a single image file, or view a folder
    3. Adjust image dimension, file size, DPI
    4. Add image or text water mark
    5. view / edit comments of jpg images
    6. Add 30+ kinds of special effects such as round corner, background, shadow, color replacement, auto brightness, etc.
    7. Convert image to ascii text
    8. View QR code, or Generate QR code from text
    9. Image conversion:
      • Image to Ico
      • image to PDF
      • PPT to Image
      • Image format conversion
    10. Support batch image operations (single image file; directory add/or its sub-directories)
    11. Support command line conversions and more …

    Dev environment setup

    1. Python 2.7.18 (32 bit)

    Download link

    1. Install pre-built binaries:

    wxPython3.0-win32-3.0.2.0-py27.exe

    pywin32-221.win32-py2.7.exe

    zbar-0.10.win32-py2.7_2.msi

    Pillow-2.4.0.win32-py2.7.exe

    numpy-1.6.2-win32-superpack-python27.exe

    pyexiv2-0.3.2-setup.exe

    matplotlib-1.2.0.win32-py2.7.exe

    wordcloud-1.6.0-cp27-cp27m-win32.whl

    1. Install packages using pip (or: pip install -r requirements.txt)

    pip install WMI==1.5.1 ## will install pywin32

    pip install configobj==4.7.2

    pip install send2trash==1.5.0

    pip install Wand==0.3.7

    pip install openpyxl==2.2.6 ## will install jdcal

    pip install qrcode==5.0.1 ## will install six

    pip install install cx-Freeze==5.1

    pip install jieba==0.42.1 ## Chinese text segmentation

    pip install pypubsub==3.3.0

    2020.01.02

    Visit original content creator repository https://github.com/QuinnSong/JPG-Tools
  • fmm-directory-compressor

    FMM Directory Compressor

    License: GPL v3 PyPI release

    Compress a directory into a single .FSA file.

    Installation

    Linux

    Debian/Ubuntu

    The project has not yet been published to any APT repository, but a .deb build is provided here.

    Windows

    Windows installer is provided here. The installer does not automatically it to the system environment path.

    Python API

    pip install fmmpy-directory-compressor
    

    Note the pip refers to the Python 3 package manager. In environment where Python 2 is also available the correct command may be pip3.

    Usage

    CLI

    Compress directory

    fmm-directory-compressor compress-directory path/to/src path/to/dst
    

    You’ll be asked to provide a filename. A .fsa file will be generated. If you are using windows, the compression might fail when your source directory contains paths that are longer than 260 characters. These file paths can be ignored with the --skip-long-paths flag, but with this method these files/directories wont be present in the compressed file.

    Decompress directory

    fmm-directory-compressor decompress-directory path/to/file.fsa path/to/dst
    

    You’ll be asked to provide a root directory name. The directory structure will be rebuild.

    Python API

    The python wrapper yields the same functionality as the CLI application. Just include the library and you’re ready to go.

    import fmm_directory_compressor
    
    ## Compress directory
    fmm_directory_compressor.compress_directory("path/to/src", "yourfilename", "path/to/dst")
    
    ## Decompress directory
    fmm_directory_compressor.decompress_directory("root-directory-name", "path/to/yourfile.fsa", "path/to/dst")
    

    Support

    If you found a problem with the software, please create an issue on GitHub.

    Maintainer

    This project is maintained by Wibo Kuipers.

    The source has been setup to work with Linux and Windows. Mac OS has not been tested yet.

    Visit original content creator repository https://github.com/w-kuipers/fmm-directory-compressor
  • denied-list-for-linkedin

    Denied List for Linkedin

    Descrição

    Bem-vindo ao repositório do Denied List for Linkedin, uma extensão simples para o Google Chrome que lhe ajudará economizar tempo e permite aos usuários filtrar vagas de emprego de acordo com suas preferências. Utilizando uma funcionalidade de denied list, você pode excluir certas vagas ou empresas dos resultados de busca, personalizando sua experiência de procura de emprego.


    Por que utilizar essa extensão?

    Recentemente, andei pesquisando algumas oportunidades de emprego, e me deparei com um desafio comum: a predominância de vagas irrelevantes no LinkedIn! originárias de outros portais de emprego. Houve casos em que uma lista de 25 vagas, aproximadamente 20 eram incompatíveis com o que eu procurava, principalmente por serem publicações de outros portais de emprego. Essa situação resultava em uma perda significativa de tempo, pois tinha que filtrar manualmente essas ofertas irrelevantes (e até irritantes).

    Então, decidi desenvolver uma solução prática: uma extensão simples para o navegador Google Chrome. O objetivo dessa ferramenta é otimizar o processo de busca por empregos, poupando não só o meu tempo, mas também o de outros usuários. A extensão funciona como um filtro eficaz, removendo automaticamente as vagas que não se alinham às suas preferências e necessidades na lista de pesquisa. Com esta extensão, a busca por vagas se torna mais direcionada e produtiva, eliminando o incômodo de navegar através de inúmeras ofertas irrelevantes.


    Tecnologias Utilizadas

    Este projeto foi desenvolvido com as seguintes tecnologias:

    • Google Chrome Extensions: As extensões do Google Chrome são aplicações que adicionam funcionalidades extras e permitem integração com sites e serviços de terceiros no navegador.
    • React: Para uma interface de usuário dinâmica e responsiva.
    • TypeScript: Para adicionar tipagem estática ao código, garantindo maior segurança e legibilidade.
    • Ant Design: Um design system que oferece componentes de UI elegantes e eficientes.

    Funcionalidades

    • Denied List de Vagas: Adicione termos ou nomes de empresas à sua denied list para que estas não apareçam em suas buscas.
    • Integração com Navegador: Funciona diretamente no Google Chrome, integrando-se perfeitamente com sua experiência de navegação.
    • Personalização Fácil: Interface intuitiva que permite adicionar ou remover itens da denied list com facilidade.

    Como Instalar

    1. Baixe a ultima versao build da extensao aqui na versao ZIP e descompacte
    2. Abra o Google Chrome e digite chrome://extensions/ na barra de endereços.
    3. Ative o Modo Desenvolvedor no canto superior direito da página de extensões.
    4. Clique em “Carregar sem compactação” e selecione a pasta da extensão descompactada no seu computador.
    5. A extensão será carregada e aparecerá na lista de extensões do Chrome.
    6. Reinicie sua pagina do linkedin para a extensao aplicar configuracoes iniciais.
    7. Para uma melhor experiencia, deixe a extensao “pinada” para sempre aparecer na sua barra de extensoes

    Como utilizar

    1. Inicie uma Busca no LinkedIn: Digite um termo de interesse na barra de pesquisa do LinkedIn para visualizar as vagas disponíveis.
    2. Identifique o Botão “Filtrar”: Nas vagas apresentadas, você notará um botão “Filtrar” adicionado pela extensão em cada uma delas.
    3. Filtre Vagas Indesejadas: Clique no botão “Filtrar” da vaga que deseja excluir das futuras buscas. Isso removerá a empresa ou a vaga específica de suas pesquisas posteriores.
    4. Gerenciamento de Filtros: Para ajustar ou revisar seus filtros atuais, clique no ícone da extensão, localizado na barra de ferramentas do Chrome. Uma interface simples permitirá que você gerencie suas preferências de filtro.

    Seguindo estes passos, a extensão ajudará a otimizar sua busca por empregos no LinkedIn, removendo automaticamente as vagas indesejadas.

    presentation


    Contribuições

    Contribuições são sempre bem-vindas! Se você tem alguma ideia ou sugestão para melhorar a extensão, sinta-se à vontade para criar um pull request ou abrir uma issue.


    Licença

    Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.

    Visit original content creator repository https://github.com/yuripinheirot/denied-list-for-linkedin