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 'package:flutter/widgets.dart'; | |
class HorizontalSnapWidget extends StatelessWidget { | |
final WidgetBuilder sampleBuilder; | |
final IndexedWidgetBuilder itemBuilder; | |
final int itemCount; | |
final double itemWidth; | |
final int initialPage; | |
final double spacing; |
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
export const Day = { | |
mon: { | |
text: "Monday", isToday() { | |
return Day.isToday(Day.mon) | |
} | |
}, | |
tue: { | |
text: "Tuesday", isToday() { | |
return Day.isToday(Day.tue) | |
} |
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
const R = 6371; // Radius of the earth in km | |
function deg2rad(deg) { | |
return deg * (Math.PI / 180) | |
} | |
/** | |
* | |
* @param latLng1 | |
* @param latLng2 |
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
// | |
// Created by Fuxing Loh on 2019-03-07. | |
// Copyright (c) 2019 Munch Technologies. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
class UICollectionViewFlowLayoutSnapping: UICollectionViewFlowLayout { | |
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { | |
// Page width used for estimating and calculating paging. |
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
<script> | |
export default { | |
mounted() { | |
// Replace place without changing querystring | |
this.$path.replace({path: '/path-name'}) | |
// Replace query string without changing path | |
this.$path.replace({query: {'foo': 'bar'}}) | |
} | |
} |
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 com.fasterxml.jackson.databind.JsonNode; | |
import dev.fuxing.utils.JsonUtils; | |
import javax.persistence.EntityManager; | |
import javax.persistence.LockModeType; | |
import java.util.function.Consumer; | |
/** | |
* Created by: Fuxing | |
*/ |
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 javax.validation.ConstraintValidator; | |
import javax.validation.ConstraintValidatorContext; | |
/** | |
* Created by: Fuxing | |
*/ | |
public class EnumValidator implements ConstraintValidator<ValidEnum, Enum> { | |
@Override | |
public boolean isValid(Enum value, ConstraintValidatorContext context) { | |
if (value == null) return false; |
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
@Test | |
void patch() { | |
AirtableRecord record = new AirtableRecord(); | |
record.putField("Name", TEST_NAME); | |
record = table.post(record); | |
record = new AirtableRecord(); | |
record.setId(record.getId()); | |
record.putField("Integer", "42"); | |
record = table.patch(record, true); |
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 app.munch.facebookappevents; | |
import android.os.Bundle; | |
import com.facebook.appevents.AppEventsLogger; | |
import io.flutter.plugin.common.MethodCall; | |
import io.flutter.plugin.common.MethodChannel; | |
import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | |
import io.flutter.plugin.common.MethodChannel.Result; | |
import io.flutter.plugin.common.PluginRegistry.Registrar; |
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
aws ecr describe-repositories --output text | awk '{print $5}' | while read line; do aws ecr list-images --repository-name $line --filter tagStatus=UNTAGGED --query 'imageIds[*]' --output text | while read imageId; do aws ecr batch-delete-image --repository-name $line --image-ids imageDigest=$imageId; done; done |