Skip to content

Instantly share code, notes, and snippets.

View vitalyisaev2's full-sized avatar

Vitaly Isaev vitalyisaev2

  • Yandex
  • Moscow, Russia
View GitHub Profile
@westonpace
westonpace / listener.py
Created March 3, 2021 19:35
Bare bones example of sending an arrow table from C++ to python via socket
#!/usr/bin/env python3
import socket
import pyarrow as pa
import pyarrow.ipc
listen = "127.0.0.1"
port = 56565
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
@liu316484231
liu316484231 / personal_access_token.go
Last active November 27, 2021 02:27
Golang Script for obtaining Gitlab API Personal Access Token
/**
* Created by bing at 2019-12-17 08:58
*/
package rscrawler
import (
"github.com/anaskhan96/soup"
"io/ioutil"
"log"
"net/http"
#include <iostream>
struct Base {
};
struct D1 : Base {
};
struct D2 : Base {
int a{10};
@Lewiscowles1986
Lewiscowles1986 / FindJemalloc.cmake
Created January 15, 2017 16:35
Find Jemalloc library (CMake)
#
# Find the JEMALLOC client includes and library
#
# This module defines
# JEMALLOC_INCLUDE_DIR, where to find jemalloc.h
# JEMALLOC_LIBRARIES, the libraries to link against
# JEMALLOC_FOUND, if false, you cannot build anything that requires JEMALLOC
# also defined, but not for general use are
@Brainiarc7
Brainiarc7 / nvenc-capabilities-ffmpeg.md
Last active October 10, 2023 23:26
See the supported NVENC and NPP capabilities in your FFmpeg build

Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:

Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:

$ for i in encoders decoders filters; do
    echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda|nvdec"
done

Sample output (as on my testbed):

@WillPlatnick
WillPlatnick / salt-encrypt.sh
Created June 9, 2016 12:18
Encrypt SaltStack Pillars
#!/usr/bin/env bash
# Usage: salt-encrypt {optional -f} <input> <keyid>, or just `salt-encrypt` for interactive mode
# Summary: Encrypt some string / file for Salt
# Help: This command can be used to gpg encrypt some content for use in salt pillars or really anything you want to encrypt with GPG
set -e
#Replace below with the default key you encrypt with
DEFAULT_RECIPIENT="XXXXXX"
multi=0
@HelenaEksler
HelenaEksler / check-files-exist-from-list.sh
Last active March 25, 2023 15:11
Bash script to check files in list exist in directory
#!/usr/bin/env bash
#Check Files in list from file exist or doesn't exist in directory.
if [ $# -eq 0 ] || [ $# -eq 1 ]
then
echo "You must pass the path to file with the list and the path to directory to check files. \nsh check-file-exist-from-list.sh path/to/file path/to/directory"
exit 1
fi
while read -r file; do
@Rubentxu
Rubentxu / maybe.go
Created September 24, 2015 23:34
Implementing the Maybe monad in Golang
package main
import (
"fmt"
"errors"
)
type Maybe interface {
Return(value interface{}) Maybe
Bind(func(interface{}) Maybe) Maybe
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@tomnomnom
tomnomnom / simple-json-api.go
Created December 20, 2014 16:34
Simple JSON API Server in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
// The `json:"whatever"` bit is a way to tell the JSON