Skip to content

Instantly share code, notes, and snippets.

View deepu105's full-sized avatar
🏠
Working from home

Deepu K Sasidharan deepu105

🏠
Working from home
View GitHub Profile
//import ...;
export interface ICheckoutProp extends StateProps, DispatchProps {}
class CheckoutContainer extends React.Component<ICheckoutProp> {
private paymentContainer = React.createRef<HTMLDivElement>();
//...
componentDidMount() {
this.props.getEntityForCurrentUser();
implementation group: "com.adyen", name: "adyen-java-api-library", version: "5.0.0"
application {
config {
baseName store
packageName com.adyen.demo.store
authenticationType jwt
prodDatabaseType mysql
buildTool gradle
clientFramework react
useSass true
enableTranslation false
@PostMapping("/checkout/payment-methods")
public ResponseEntity<PaymentMethodsResponse> paymentMethods() throws EntityNotFoundException, IOException, ApiException {
PaymentMethodsRequest paymentMethodsRequest = new PaymentMethodsRequest();
paymentMethodsRequest.setMerchantAccount(merchantAccount);
paymentMethodsRequest.setCountryCode("NL");
paymentMethodsRequest.setShopperLocale("nl-NL");
paymentMethodsRequest.setChannel(PaymentMethodsRequest.ChannelEnum.WEB);
Amount amount = getAmountFromCart();
paymentMethodsRequest.setAmount(amount);
//import ...;
export interface ICartProp extends StateProps, DispatchProps {}
export const Cart = (props: ICartProp) => {
useEffect(() => {
props.getEntityForCurrentUser();
}, []);
const remove = id => () => {
@deepu105
deepu105 / e-commerce-app.jdl
Created June 24, 2020 14:11
Adyen E-Commerce JDL
/** Product sold by the Online store */
entity Product {
name String required
description String
price BigDecimal required min(0)
size Size required
image ImageBlob
}
enum Size {
@deepu105
deepu105 / rust-stack-vs-heap.rs
Created March 30, 2020 17:55
Rust stack vs heap usage
use std::fs::File;
use std::io::prelude::*;
use std::usize;
fn lookup_ptr(addr: usize) -> std::io::Result<Option<String>> {
let mut contents = String::new();
File::open("/proc/self/maps")?.read_to_string(&mut contents)?;
Ok(contents
.split("\n")
// Uncomment this if you are only interested in stack and heap
@deepu105
deepu105 / rust-ownership.rs
Created March 30, 2020 17:54
Rust ownership and lifetimes
// This function takes ownership of the passed value
fn take_ownership(value: Box<i32>) {
println!("Destroying box that contains {}", value); // value is destroyed here, and memory gets freed
}
// This function borrows the value by reference
fn borrow(reference: &i32) {
println!("This is: {}", reference);
}
### JHipster Developers Association Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (**"Projects"**)
made available by [JHipster Developers Association](https://www.jhipster.tech/association/)
or its affiliates (the **"Association"**). This Individual Contributor License Agreement (**"CLA"**) sets out the
terms governing any source code, object code, bug fixes, configuration changes, tools, specifications,
documentation, data, materials, feedback, information or other works of authorship that you submit or
have submitted, in any form and in any manner, to the Association in respect of any of the Projects
(collectively **“Contributions”**). If you have any questions respecting this Agreement,
please contact **info@jhipster.tech**
@deepu105
deepu105 / jhipster-book-online-store-istio.jdl
Created December 10, 2019 21:22
jhipster-book-online-store-istio.jdl
/* Store gateway application */
application {
config {
baseName store
applicationType gateway
packageName com.mycompany.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql