Skip to content

Instantly share code, notes, and snippets.

View vehsamrak's full-sized avatar
❤️

Petr Karmashev vehsamrak

❤️
View GitHub Profile
@Pagliacii
Pagliacii / neovim-as-merge-tool.md
Last active November 2, 2025 20:55
Using Neovim as a merge tool

git

Using diffview.nvim

# ~/.gitconfig
[merge]
  tool = diffview
[mergetool]
  prompt = false
@Xavier59
Xavier59 / privatekeysolana.js
Created December 28, 2021 14:49
Convert Solana private key from/to base58/uint8array
// exporting from a bs58 private key to an Uint8Array
// == from phantom private key to solana cli id.json key file
// npm install bs58 @solana/web3.js
const web3 = require("@solana/web3.js");
const bs58 = require('bs58');
let secretKey = bs58.decode("[base58 private key here]");
console.log(`[${web3.Keypair.fromSecretKey(secretKey).secretKey}]`);
// exporting back from Uint8Array to bs58 private key
@montethinks
montethinks / work.sh
Last active February 21, 2024 11:27
Start tmux with preconfigured windows and panes.
#!/bin/sh
# Setup a work space called `work` with four windows
session="work"
# set up tmux
tmux start-server
# create a new tmux session with <NAME>
@hamdouni
hamdouni / AlpineLinuxGraphicVirtualbox.sh
Last active May 12, 2023 09:52
Alpine Linux Graphic in Virtualbox
apk update
apk add udev xorg-server xf86-input-evdev xf86-video-vesa setxkbmap
apk add build-base git libcurl libxft-dev libx11-dev libxinerama-dev lxterminal
apk add ca-certificates wget
update-ca-certificates
rc-update add udev sysinit
rc-update add udev-postmount default
git clone https://github.com/hamdouni/myDwm
cd myDwm/programs/dwm-6.0
make && make install
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@mcarrowd
mcarrowd / main.go
Last active January 1, 2024 21:58
golang win1251 <-> utf8 encoding issue demonstration
package main
import (
"fmt"
"golang.org/x/text/encoding/charmap"
)
func main() {
for i := 0; i <= 255; i++ {
charnum := uint8(i)
@andrewmilson
andrewmilson / file-upload-multipart.go
Last active June 28, 2025 18:41
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"