Skip to content

Instantly share code, notes, and snippets.

View c0mm4nDer's full-sized avatar
👩‍💻
Working from home

Sayied Amir Ahmadi c0mm4nDer

👩‍💻
Working from home
View GitHub Profile
@virolea
virolea / upload.js
Last active June 11, 2024 06:48
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@mfmendiola
mfmendiola / ArrayUtil.java
Last active April 5, 2023 19:10
ReadableArray and ReadableMap serialization helpers for the React Native—Android bridge.
/*
ArrayUtil exposes a set of helper methods for working with
ReadableArray (by React Native), Object[], and JSONArray.
MIT License
Copyright (c) 2020 Marc Mendiola
Permission is hereby granted, free of charge, to any person obtaining a copy
@jayrambhia
jayrambhia / CardPagerTransformerBasic.java
Last active December 21, 2019 05:55
ViewPager Cards
public class CardsPagerTransformerBasic implements ViewPager.PageTransformer {
private int baseElevation;
private int raisingElevation;
private float smallerScale;
public CardsPagerTransformerBasic(int baseElevation, int raisingElevation, float smallerScale) {
this.baseElevation = baseElevation;
this.raisingElevation = raisingElevation;
this.smallerScale = smallerScale;
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);