Skip to content

Instantly share code, notes, and snippets.

View NaserKhoshfetrat's full-sized avatar

Naser Khoshfetrat NaserKhoshfetrat

View GitHub Profile
@NaserKhoshfetrat
NaserKhoshfetrat / Retry.java
Created November 9, 2020 16:41 — forked from dtodt/Retry.java
[email protected] - Retry Adapter Factory - Call & CompletableFuture
package com.company.retrofit2.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
@NaserKhoshfetrat
NaserKhoshfetrat / Api.java
Created November 9, 2020 16:40 — forked from imminent/Api.java
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {
@NaserKhoshfetrat
NaserKhoshfetrat / .gitignore
Created September 28, 2020 09:01
android studio 4 git ignore
#built application files
*.apk
*.ap_
# files for the Dalvik VM
*.dex
# Java class files
*.class
USE [SmsPanel_v2]
GO
/****** Object: UserDefinedFunction [dbo].[Scalar_Function_BALANCE_CHECK_USERNAME] Script Date: 8/7/2018 12:34:06 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[Scalar_Function_BALANCE_CHECK_USERNAME]
(
@NaserKhoshfetrat
NaserKhoshfetrat / create a custom user name and password validator.txt
Last active August 4, 2018 16:31
create a custom user name and password validator
To create a custom user name and password validator
1.Create a class that derives from :System.IdentityModel.Selectors.UserNamePasswordValidator
2.Implement the custom authentication scheme by overriding the Validate method.
public override void Validate(string userName, string password)
{
if (userName == null || password == null)
@NaserKhoshfetrat
NaserKhoshfetrat / call post method
Created July 23, 2018 06:54
c# call post api method
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
@NaserKhoshfetrat
NaserKhoshfetrat / postBackByObject.js
Created July 23, 2018 05:27
javascript postBackByObject
function postBackByObject(e) {
var evnt = ((window.event) ? (event) : (e));
var element = evnt.srcElement || evnt.target;
if (element.tagName == "INPUT" && element.type == "checkbox") {
__doPostBack("", "");
}
}
body{
background-color:#f4f4f4;
color:#555;
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
line-height:1.6em;
margin:0;
}
.container{
@NaserKhoshfetrat
NaserKhoshfetrat / TimeStamp().js
Created July 4, 2018 04:36
get TimeStamp javascript
function Func_TimeStamp() {
var ts = Math.round((new Date()).getTime() / 1000);
return ts;
}
@NaserKhoshfetrat
NaserKhoshfetrat / func_init_DateTime_select.js
Last active July 2, 2018 10:26
javascript fill select element
function func_init_DateTime_select(SelectEelemntDateID, SelectEelemntHourID, SelectEelemntMinuteID) {
var SelectEelemntDate = document.getElementById(SelectEelemntDateID);
var SelectEelemntHour = document.getElementById(SelectEelemntHourID);
var SelectEelemntMinute = document.getElementById(SelectEelemntMinuteID);
//initilizing the send date
for (let i = 0; i <= 16; i++) {
var option = document.createElement("option");
if (i === 0) {
option.text = `در روز موعد مقرر`;