Read window logs in Golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- Migrating every column in schema from json type to jsonb type. | |
| -- Postgresql 9.5+ | |
| -- | |
| BEGIN; | |
| DO LANGUAGE plpgsql $$ | |
| DECLARE | |
| r information_schema.columns%ROWTYPE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "errors" | |
| "log" | |
| "github.com/libgit2/git2go" | |
| ) | |
| func checkoutBranch(repo *git.Repository, branchName string) error { | |
| checkoutOpts := &git.CheckoutOpts{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |