This file contains 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
Table products { | |
name product | |
Indexes { | |
(name) [pk] | |
} | |
} | |
Table organizations { | |
id uuid | |
name text |
This file contains 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 monitorHealth(ctx context.Context, cc *grpc.ClientConn, cancelConn func()) { | |
defer cancelConn() | |
defer cc.Close() | |
healthClient := grpc_health_v1.NewHealthClient(cc) | |
wc, err := healthClient.Watch(ctx, &grpc_health_v1.HealthCheckRequest{}) | |
if err != nil { | |
bklog.G(ctx). | |
WithError(err). |
This file contains 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 monitorHealth(ctx context.Context, cc *grpc.ClientConn, cancelConn func()) { | |
defer cancelConn() | |
defer cc.Close() | |
ticker := time.NewTicker(1 * time.Second) | |
defer ticker.Stop() | |
healthClient := grpc_health_v1.NewHealthClient(cc) | |
for { | |
select { |
This file contains 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 ( | |
"encoding/base64" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" | |
"os" |
This file contains 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
echo "Authorizing with MS" | |
curl -s --request POST \ | |
--url https://login.microsoftonline.com/$AZURE_TENANT_ID/oauth2/token \ | |
--header 'content-type: application/x-www-form-urlencoded' \ | |
--data-urlencode "grant_type=password" \ | |
--data-urlencode "resource=https://graph.windows.net" \ | |
--data-urlencode "client_id=$SPINNAKER_CLIENT_ID" \ | |
--data-urlencode "password=$BUILD_PASSWORD" \ | |
--data-urlencode "client_secret=$SPINNAKER_CLIENT_SECRET" \ | |
--data-urlencode "username=$BUILD_USER" \ |
This file contains 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 static class ObjectExtensions | |
{ | |
public static T CastByExample<T>(this object o, T example) | |
{ | |
return (T) o; | |
} | |
} | |
void Main() | |
{ |
This file contains 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 AlwaysTrue | |
{ | |
public static bool operator true(AlwaysTrue alwaysTrue) | |
{ | |
return true; | |
} | |
public static bool operator false(AlwaysTrue boyfriend) | |
{ | |
return true; |
This file contains 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
void Main() | |
{ | |
var answer = new ThisIsTrue(); | |
if(answer) | |
Console.WriteLine("Paradox ain't nuthin for .NET"); | |
} | |
public class ThisIsTrue | |
{ |
This file contains 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
void Main() | |
{ | |
var boyfriends = new List<Boyfriend> | |
{ | |
new Boyfriend | |
{ | |
LovesMe = true, | |
LovesMeNot = false, | |
EntriesOnRapSheet = int.MaxValue, | |
Name = "Ima Baddude" |
This file contains 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
Banker|Away|Convert|Cast | |
0 | 1 | 0 | 0 | |
2 | 2 | 2 | 1 | |
2 | 3 | 2 | 2 | |
4 | 4 | 4 | 3 | |
4 | 5 | 4 | 4 |
NewerOlder