Skip to content

Instantly share code, notes, and snippets.

View olkunmustafa's full-sized avatar

olkunmustafa olkunmustafa

View GitHub Profile
@olkunmustafa
olkunmustafa / CartResponse
Last active July 26, 2023 09:55
ChatGPT Question
{"couponCode":null,"couponName":"$50 Shipping Campaign","deliveryFee":5.0,"anchoredDeliveryFee":0.0,"deliveryFeeObj":{"value":5.0,"valueStr":"$5.00","currency":"$","currencyIso":"USD"},"tipType":0,"tip":0.0,"freeDeliveryFeeInfoText":" ","freeDeliveryFeeInfoTitle":"Free delivery on orders over $50!","freeDeliveryFeeText":"Free Delivery","isShowDeliveryFee":true,"minBasketPriceWarningText":"","freeDeliveryFeePercent":187.02,"basketType":10,"cartShareId":"66d35246-d068-4676-a153-dbee424c613d","credit":0.00,"creditPriceObj":{"value":0.00,"valueStr":"$0.00","currency":"$","currencyIso":"USD"},"balancePriceObj":{"value":0.0,"valueStr":"$0.00","currency":"$","currencyIso":"USD"},"maxUsableBalanceObj":{"value":0.0,"valueStr":"$0.00","currency":"$","currencyIso":"USD"},"tipPrice":0.0,"tipPriceObj":{"value":0.0,"valueStr":"$0.00","currency":"$","currencyIso":"USD"},"subTotal":97.60,"subTotalObj":{"value":97.60,"valueStr":"$97.60","currency":"$","currencyIso":"USD"},"total":102.60,"totalObj":{"value":102.60,"valueStr":"
@olkunmustafa
olkunmustafa / product endpoint
Created March 12, 2019 12:00
Json response when requested to /product endpoint with account equal to nc-companyadmin@zingat.com
This file has been truncated, but you can view the full file.
{
"_links": {
"self": {
"href": "http://mapi.zingat.com/product"
}
},
"_embedded": {
"items": [
{
"id": 34,
@olkunmustafa
olkunmustafa / me-contract endpoint
Created March 12, 2019 11:48
Json response when requested to me/contract endpoint.
{
"_links": {
"self": {
"href": "http://mapi.zingat.com/me/contract"
}
},
"_embedded": {
"contract": [
{
"id": 13411,
/**
* This filter uses to add new Header elements
* or it can be added new Log elements.
*
* @since 0.1.1
*/
private class ProgressFilter implements ServiceFilter {
/**
* @param request Request object
// 9001 : Tüm alanlar doldurulmalı mesjaı verir.
// 9004 : Bu mail adresine ait bir kullanıcı yok!
// 9005 : Mail adresine ait kayıt geri dönüldü!
var mailAddress, userPass;
module.exports = {
get : function(request, response, next) {
mailAddress = request.query.mailAddress;
// 9001 : Tüm alanlar doldurulmalı mesjaı verir.
// 9002 : Bu mail adresine ait bir kullanıcı zaten var.
// 9003 : Kayıt yapıldı ve değerler geri dönüldü.
var userName, mailAddress, password;
module.exports = {
post : function(request, response, next) {
userName = request.body.userName;
mailAddress = request.body.mailAddress;
@olkunmustafa
olkunmustafa / DimensionHelper.java
Created August 13, 2016 05:08
Uses to convert to px from dip or vice versa.
package com.fallavi.android.utils;
import android.content.res.Resources;
import android.util.DisplayMetrics;
/**
* Created by olkunmustafa on 13/08/16
*
* Gives dimensions according to device's denisty
*/
@olkunmustafa
olkunmustafa / SmoothScroll.java
Created July 12, 2016 08:09
Used when it is wanted to set selection listview with animation.
public void smootScroolListview() {
int duration = 300;//ms
int position = mListView.getFirstVisiblePosition();
int getHight = mListView.getHeight();
mListView.smoothScrollBy( ( ( getHight * position ) * -1 ), duration * 2 );
this.mListView.postDelayed( new Runnable() {
@Override
public void run() {
@olkunmustafa
olkunmustafa / DoubleClickListener.java
Created July 12, 2016 06:48
Used As a lightweight alternative to GestureDetector you can use this class
public abstract class DoubleClickListener implements OnClickListener {
private static final long DOUBLE_CLICK_TIME_DELTA = 300;//milliseconds
long lastClickTime = 0;
@Override
public void onClick(View v) {
long clickTime = System.currentTimeMillis();
if (clickTime - lastClickTime < DOUBLE_CLICK_TIME_DELTA){
@olkunmustafa
olkunmustafa / SimpleBaseAdapter.java
Created July 11, 2016 17:58
It can be used creating new BaseAdapters. It makes easier the process.
package com.verisun.core;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.ArrayList;
public abstract class SimpleBaseAdapter<T> extends BaseAdapter {