Skip to content

Instantly share code, notes, and snippets.

View inspirit941's full-sized avatar

Donggeon Lee inspirit941

View GitHub Profile
func (r *Reconciler) ReconcileKind(ctx context.Context, source *sourcesv1alpha1.GitHubSource) pkgreconciler.Event {
source.Status.InitializeConditions()
accessToken, err := r.secretFrom(ctx, source.Namespace, source.Spec.AccessToken.SecretKeyRef)
if err != nil {
source.Status.MarkNoSecrets("AccessTokenNotFound", "%s", err)
return err
}
secretToken, err := r.secretFrom(ctx, source.Namespace, source.Spec.SecretToken.SecretKeyRef)
if err != nil {
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
payload, err := h.Hook.Parse(r, ValidEvents...)
if err != nil {
if err == gh.ErrEventNotFound {
w.WriteHeader(http.StatusNotFound)
h.Logger.Info("Event not found")
return
}
w.WriteHeader(http.StatusBadRequest)
h.Logger.Errorf("Error processing request: %v", err)
// RegisterHandlerFor implements MTAdapter.
func (a *gitHubAdapter) RegisterHandlerFor(ctx context.Context, src *v1alpha1.GitHubSource) error {
secretCli := a.secrGetter.Secrets(src.Namespace)
secretToken, err := common.SecretFrom(ctx, secretCli, src.Spec.SecretToken.SecretKeyRef)
if err != nil {
return fmt.Errorf("reading token from Secret: %w", err)
}
logger := logging.FromContext(ctx)
ceSrc := v1alpha1.GitHubEventSource(src.Spec.OwnerAndRepository)
func (a *gitHubAdapter) Start(ctx context.Context) error {
// Start our multi-tenant server receiving GitHub events
server := &http.Server{
ReadTimeout: 10 * time.Second,
ReadHeaderTimeout: 2 * time.Second,
Addr: fmt.Sprintf(":%d", a.port),
Handler: a.router,
}
done := make(chan bool, 1)
@inspirit941
inspirit941 / gemini_object_finetune.ipynb
Last active November 2, 2024 10:03
gemini_object_finetune.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@inspirit941
inspirit941 / image_clustering.ipynb
Created March 27, 2024 09:24
image_clustering.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@inspirit941
inspirit941 / clip-handson-example.ipynb
Created March 26, 2024 08:48
clip-handson-example.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.