kubectl create job --from=cronjob/<name of cronjob> <name of job>
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 ( | |
"fmt" | |
"time" | |
) | |
// Suggestions from golang-nuts | |
// http://play.golang.org/p/Ctg3_AQisl |
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
// testing output | |
reflectedStruct := reflect.ValueOf(event) | |
// in case you want to list all values stored at the location of this pointer to a struct | |
if reflectedStruct.Kind() == reflect.Ptr { | |
reflectedStruct = reflectedStruct.Elem() | |
} |
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 ingest(out <-chan []string) { | |
out <- []string{"aaaa", "bbb"} | |
out <- []string{"cccccc", "dddddd"} | |
out <- []string{"e", "fffff", "g"} | |
close(out) | |
} | |
func process(in <-chan []string, out <-chan int) { | |
for data := range in { | |
for _, word := range data { |
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 ( | |
"fmt" | |
"reflect" | |
) | |
func dump_interface_array(args interface{}) { | |
val := reflect.ValueOf(args) | |
fmt.Println(val.Kind()) |
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 ( | |
"fmt" | |
"reflect" | |
) | |
type Test struct { | |
Name string | |
} |
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
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
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
!/bin/bash | |
# Inspired from: https://github.com/grpc/grpc-java/tree/master/examples#generating-self-signed-certificates-for-use-with-grpc | |
# Output files | |
# ca.key: Certificate Authority private key file (this shouldn't be shared in real-life) | |
# ca.crt: Certificate Authority trust certificate (this should be shared with users in real-life) | |
# server.key: Server private key, password protected (this shouldn't be shared) | |
# server.csr: Server certificate signing request (this should be shared with the CA owner) | |
# server.crt: Server certificate signed by the CA (this would be sent back by the CA owner) - keep on server | |
# server.pem: Conversion of server.key into a format gRPC likes (this shouldn't be shared) |
The objective is to build a web-application that does some analysis of a web-page/URL.
- The application should show a form with a text-field thus the user can type in the URL of the webpage being analyzed.
- Additionally to form should contain a button for sending the input to the server as well as to trigger the server-side analysis process.
- After processing the results should be shown to the user in terms of a simple table below to the form. The result comprises the following information:
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
"""A post-update Git hook to execute `composer install` when composer.json changes | |
:Author: Cody Halovich | |
:Company: HootSuite Media Inc. | |
""" | |
import subprocess |