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
| // problem : the placeholder '?' could be changed by ToSQL() ! | |
| query, args, err := db.SelectFrom("noeud").Columns("id").Where("identifiant like ?", "00%").ToSQL() | |
| ... | |
| nodes := make([]Noeud, 0, 0) | |
| err = db.Select(&nodes).Where("id in ("+query+")", args...).Do() | |
| ... | |
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
| #!/bin/bash | |
| # Testing godb ( https://github.com/samonzeweb/godb ) with SQL Server on OSX / Linux | |
| docker run --name sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=NotSoStr0ngP@ssword' -p 1433:1433 -d microsoft/mssql-server-linux:latest | |
| docker exec -i sqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P NotSoStr0ngP@ssword <<-EOF | |
| create database godb; | |
| go | |
| exit |
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
| #!/bin/bash | |
| # Testing godb ( https://github.com/samonzeweb/godb ) with PostgreSQL | |
| docker run --name postgresql -e 'POSTGRES_PASSWORD=NotSoStr0ngPassword' -p 5432:5432 -d postgres:latest | |
| sleep 5 | |
| # See https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters | |
| GODB_POSTGRESQL="postgres://postgres:NotSoStr0ngPassword@localhost/postgres?sslmode=disable" go test |
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
| #!/bin/bash | |
| docker run --name mariadb -e 'MYSQL_ROOT_PASSWORD=NotSoStr0ngPassword' -p 3306:3306 -d mariadb:latest | |
| sleep 10 | |
| docker exec -it mariadb mysql -uroot -pNotSoStr0ngPassword -hlocalhost -e "create database godb;" | |
| # See https://github.com/go-sql-driver/mysql#dsn-data-source-name | |
| GODB_MYSQL="root:NotSoStr0ngPassword@/godb?parseTime=true" go test |
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
| Testing godb ( https://github.com/samonzeweb/godb ) on MS Windows | |
| (cgo/gcc related to github.com/mattn/go-sqlite3) | |
| Source : https://github.com/mattn/go-sqlite3/issues/212#issuecomment-185036480 | |
| Install MSYS2 (64 bits) | |
| - http://www.msys2.org/ | |
| - https://github.com/msys2/msys2/wiki/MSYS2-installation |
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
| # Proxy API to avoid CORS problems during development : | |
| # - Get Caddy from https://caddyserver.com/ | |
| # - Put the Caddyfile somewhere with the Caddy executable | |
| # - Change posts, paths, ... as needed | |
| # - Start the Caddy process (without args) | |
| # - Lauch the SPA using the URL http://localhost:8081 | |
| localhost:8081 | |
| log stderr |
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 | |
| // ---------- | |
| // How to developp with Vue.js and golang (or other JS framework) | |
| // (awful almost raw notes) | |
| // | |
| // ---------- | |
| // Create a projet ClientVue with vue-cli | |
| // | |
| // For developpment with webpack add a proxy to |
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
| # SQL Sever & firewall : https://docs.microsoft.com/en-us/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access | |
| # New-NetFirewallRule : https://docs.microsoft.com/en-us/powershell/module/netsecurity/new-netfirewallrule?view=win10-ps | |
| New-NetFirewallRule -DisplayName "SQLServer default instance" -Direction Inbound -LocalPort 1433 -Protocol TCP -Action Allow | |
| New-NetFirewallRule -DisplayName "SQLServer Browser service" -Direction Inbound -LocalPort 1434 -Protocol UDP -Action Allow |
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
| # Script parameters | |
| $pathToClean = 'C:\paht\to\somewhere' | |
| $maxDays = 5 | |
| # Computed values, don't touch below | |
| $dateLimit = (Get-Date).AddDays(-1 * $maxDays) | |
| Get-ChildItem $pathToClean | | |
| Where { $_.CreationTime -lt $dateLimit } | | |
| Remove-Item -Recurse #-WhatIf |
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
| # SQL Server parameters | |
| $serverInstance = 'localhost' | |
| # Backup parameters | |
| $backupDirectory = 'C:\path\to\backup\dir' | |
| $retentionDays = 10 | |
| # Mail parameters | |
| $mailFrom = '[email protected]' | |
| $mailTo = '[email protected]' |
OlderNewer