- Makefile
- Dockerfile
- Github Actions
- Goreleaser
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
| using Dapper; | |
| using Oracle.ManagedDataAccess.Client; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters { | |
| private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( ); |
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
| public class SomeClass { | |
| public void SomeMethod() { | |
| this.Log().Info(() => "Here is a log message with params which can be in Razor Views as well: '{0}'".FormatWith(typeof(SomeClass).Name)); | |
| } | |
| } |
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 dumptransport | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| type DumpTransport struct { | |
| r http.RoundTripper |
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( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
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
| func InsertOrder(order *Order) (int, error) { | |
| var id int | |
| tx, err := db.Begin() | |
| if err != nil { | |
| return id, err | |
| } | |
| { |
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
| CREATE OR REPLACE FUNCTION CRC32(VARCHAR) RETURNS BIGINT AS | |
| $BODY$ | |
| DECLARE | |
| src alias FOR $1; | |
| crc BIGINT not null default x'ffffffff'::BIGINT; | |
| len INTEGER not null default 0; | |
| i INTEGER not null DEFAULT 1; | |
| table BIGINT[] not null DEFAULT ARRAY[ | |
| x'00000000'::BIGINT, x'77073096'::BIGINT, x'EE0E612C'::BIGINT, x'990951BA'::BIGINT, | |
| x'076DC419'::BIGINT, x'706AF48F'::BIGINT, x'E963A535'::BIGINT, x'9E6495A3'::BIGINT, |
See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
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 ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Foo struct { | |
| FirstName string `tag_name:"tag 1"` | |
| LastName string `tag_name:"tag 2"` |
Postgres has built-in mechanism for notifying clients (listeners) of events such as INSERT, UPDATE, and DELETE on tables.
Note that for this to work, a listener must have a dedicated direct connection to Postgres. Connection poolers like pgbouncer would not work.
First, lets go over some key Postgres components:
triggers- automatically executes some function when an event on a table occurschannels- a communication mechanism identified by a string in postgres
OlderNewer