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
// addTypeInformationToObject adds TypeMeta information to a runtime.Object based upon the loaded scheme.Scheme | |
// inspired by: https://github.com/kubernetes/cli-runtime/blob/v0.19.2/pkg/printers/typesetter.go#L41 | |
func addTypeInformationToObject(obj runtime.Object) error { | |
gvks, _, err := scheme.Scheme.ObjectKinds(obj) | |
if err != nil { | |
return fmt.Errorf("missing apiVersion or kind and cannot assign it; %w", err) | |
} | |
for _, gvk := range gvks { | |
if len(gvk.Kind) == 0 { |
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
#![allow(unused)] | |
use { | |
futures::{ | |
future::{BoxFuture, FutureExt}, | |
task::{ArcWake, waker_ref}, | |
}, | |
std::{ | |
future::Future, | |
pin::Pin, |
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
// ==UserScript== | |
// @name add tomator timer for toggle | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author yanick | |
// @match toggl.com/* | |
// @match app.clickup.com/* | |
// @grant GM_addStyle | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js |
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
import java.util.LinkedList; | |
import java.util.Queue; | |
import java.util.Stack; | |
public class TreeSearch { | |
public static void depthFirstSearchWithStack(int[][] adjMatrix) { | |
boolean[] visitors = new boolean[adjMatrix.length]; | |
Stack<Integer> stack = new Stack<>(); |
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
web: | |
image: 'gitlab/gitlab-ce:latest' | |
restart: always | |
hostname: 'gitlab.example.com' | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
external_url 'http://git.mschina.io' | |
gitlab_rails['smtp_enable'] = true | |
gitlab_rails['smtp_address'] = 'smtp.mailgun.org' | |
gitlab_rails['smtp_port'] = 587 |
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 abstract class BaseLoaneeRepayment implements Repayment { | |
@Autowired | |
protected LoanRepository loanRepository; | |
@Transactional(propagation = Propagation.REQUIRES_NEW) | |
public final void repay(RepaymentInfo repaymentInfo) { | |
Loan loan = loanRepository.lockAndLoad(repaymentInfo.getLoan().id()); | |
} | |
protected abstract void preCheck(final RepaymentInfo repaymentInfo); |