Skip to content

Instantly share code, notes, and snippets.

View aywan's full-sized avatar
🙃

Ivan Bragin aywan

🙃
  • Moscow
View GitHub Profile
@aywan
aywan / !Window Logs in Golang.md
Created July 27, 2023 14:52 — forked from will7200/!Window Logs in Golang.md
Read Windows Logs in Golang

Read window logs in Golang

@aywan
aywan / githook.sh
Created May 17, 2021 04:47
Simple git hook script.
#!/usr/bin/env bash
#
# Simple git hook script.
#
# 1. Create hooks directory inside any folder at your project dir.
# 2. Create executables in hooks dir, name should start with hook name (ex. pre-commit.sh, pre-commit.0.sh)
# 3. Put githook.sh into project dir.
# 4. Run "githook.sh install"
#
@aywan
aywan / update_json_to_jsonb.sql
Created October 10, 2018 04:45
Migrating every column in schema from json type to jsonb type, postgreslq 9.5+
--
-- Migrating every column in schema from json type to jsonb type.
-- Postgresql 9.5+
--
BEGIN;
DO LANGUAGE plpgsql $$
DECLARE
r information_schema.columns%ROWTYPE;
@aywan
aywan / git2go-merge-local-branch.go
Created February 6, 2018 15:40 — forked from danielfbm/git2go-merge-local-branch.go
how to merge two local branches using git2go
package main
import (
"errors"
"log"
"github.com/libgit2/git2go"
)
func mergeBranches(repo *git.Repository, sourceBranchName string, destinationBranchName string) error {
// Assuming that these two branches are local already
sourceBranch, err := repo.LookupBranch(sourceBranchName, git.BranchLocal)
@aywan
aywan / git2go-checkout-branch.go
Created February 6, 2018 15:40 — forked from danielfbm/git2go-checkout-branch.go
How to do a git checkout branch using git2go
package main
import (
"errors"
"log"
"github.com/libgit2/git2go"
)
func checkoutBranch(repo *git.Repository, branchName string) error {
checkoutOpts := &git.CheckoutOpts{
<VirtualHost *:80>
ServerName cargo.dev
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined