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/sh | |
| URL="https://0x0.st" | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: 0x0.st FILE\n" | |
| exit 1 | |
| fi | |
| FILE=$1 |
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
| pipelines: | |
| branches: | |
| <BRANCH_NAME>: | |
| - step: | |
| services: | |
| - docker | |
| name: Deploy to GKE | |
| deployment: staging | |
| image: google/cloud-sdk:latest | |
| script: |
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
| -- split-string-into-rows.sql | |
| -- Duane Hutchins | |
| -- https://www.github.com/duanehutchins | |
| -- Split a string into a mysql resultset of rows | |
| -- This is designed to work with a comma-separated string (csv, SET, array) | |
| -- To use a delimiter other than a comma: | |
| -- Just change all the occurrences of ',' to the new delimiter | |
| -- (four occurrences in SET_EXTRACT and one occurrence in SET_COUNT) |
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
| //ISODate struct | |
| type ISODate struct { | |
| Format string | |
| time.Time | |
| } | |
| //UnmarshalJSON ISODate method | |
| func (Date *ISODate) UnmarshalJSON(b []byte) error { | |
| var s string | |
| if err := json.Unmarshal(b, &s); err != nil { |
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" | |
| "github.com/jinzhu/gorm" | |
| _ "github.com/jinzhu/gorm/dialects/postgres" | |
| ) | |
| // Customer ... | |
| type Customer 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 main | |
| import ( | |
| "fmt" | |
| "log" | |
| "time" | |
| "github.com/jinzhu/gorm" | |
| _ "github.com/jinzhu/gorm/dialects/sqlite" | |
| "github.com/satori/go.uuid" |
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 | |
| # USAGE: CLUSTER=mycluster SERVICE=myservice ./docker-exec-ecs.sh | |
| set -euf -o pipefail | |
| TASK_ARN=$(aws ecs list-tasks --cluster=$CLUSTER --service=$SERVICE \ | |
| | jq -r .taskArns[0]) | |
| if [ "$TASK_ARN" = "null" ]; then | |
| echo "Could not find any running tasks for $SERVICE on cluster:$CLUSTER." | |
| exit 1 | |
| fi |
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 FUNCTION JSON_UNIQ(arr JSON) RETURNS json | |
| BEGIN | |
| SET @arr = arr; | |
| SET @a_length = JSON_LENGTH(@arr); | |
| SET @loop_index = @a_length; | |
| WHILE @loop_index >= 0 DO | |
| SET @item = JSON_UNQUOTE(JSON_EXTRACT(@arr, concat('$[',@loop_index,']'))); |
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
| Mock<IConfiguration> configuration = new Mock<IConfiguration>(); | |
| configuration.Setup(c => c.GetSection(It.IsAny<String>())).Returns(new Mock<IConfigurationSection>().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
| using System.Collections.Generic; | |
| namespace Extensions | |
| { | |
| public static class EnumerablePaginationExtensions | |
| { | |
| public static IEnumerable<IEnumerable<T>> Paginate<T>(this IEnumerable<T> items, int pageSize) | |
| { | |
| var page = new List<T>(); | |
| foreach (var item in items) |
NewerOlder