An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
## | |
## This nginx.conf servers as the main config file for webflow reverse proxy | |
## | |
## RCS: | |
## https://gist.github.com/sansmischevia/5617402 | |
## | |
## Hardening tips: | |
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html | |
## |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
package equilib | |
// Indices returns any of the equilibrium indices, -1 if there is not one | |
func Indices(nums []int) int { | |
if len(nums) > 10 { | |
return -2 | |
} | |
for i := 0; i < len(nums); i++ { | |
left := sum(nums[0:i]) | |
right := sum(nums[i+1:]) |
func genStruct() gopter.Gen { | |
return genStrucType().FlatMap( | |
func(arg interface{}) gopter.Gen { | |
// typ := arg.(reflect.Type) | |
// Q: How to construct a generator? | |
return nil | |
}, | |
reflect.TypeOf((interface{})(nil)), | |
) | |
} |
/* | |
Copyright 2016 Alex Smolen (https://alexsmolen.com) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
#!/bin/bash -e | |
# Usage ./k8s-service-account-kubeconfig.sh ( namespace ) ( service account name ) | |
TEMPDIR=$( mktemp -d ) | |
trap "{ rm -rf $TEMPDIR ; exit 255; }" EXIT | |
SA_SECRET=$( kubectl get sa -n $1 $2 -o jsonpath='{.secrets[0].name}' ) |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
a := []int{1, 2, 3, 4} |
package main | |
import ( | |
"github.com/apex/go-apex" | |
"github.com/apex/go-apex/kinesis" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/firehose" | |
) |
package main | |
import ( | |
"log" | |
"encoding/json" | |
"fmt" | |
"os" | |
"math/rand" |