This file contains hidden or 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 * as React from 'react'; | |
import { StyleSheet, TextInput, TouchableOpacity, View } from 'react-native'; | |
interface IRadarTextInput { | |
setValue: (value: string) => void; | |
value: string; | |
placeHolder: string; | |
isSecure: boolean; | |
} |
This file contains hidden or 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 HttpsCallable = firebase.functions.HttpsCallable; | |
import HttpsCallableResult = firebase.functions.HttpsCallableResult; | |
import { PureComponent, ReactElement } from 'react'; | |
interface FireProps<T, V> { | |
callable: HttpsCallable; | |
initalData: T; | |
processData?: (result: HttpsCallableResult) => T; | |
dataToSend?: V; | |
render: (state: FireState<T>) => ReactElement<any>; |
This file contains hidden or 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 React, { Component } from "react"; | |
class App extends Component { | |
state = { | |
currentTodo: "", | |
todos: [] | |
}; | |
addTodo = () => { | |
this.setState(prev => { |
This file contains hidden or 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
<html> | |
<body> | |
<style> | |
input:focus { | |
outline-width: 0; | |
} | |
</style> | |
<script> | |
let todos = []; | |
function addTodo() { |
This file contains hidden or 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
public static <T,U> Observable<Response<T>> createRequest(U data, Func1<U, Call<T>> endpoint){ | |
return Observable.create(new Observable.OnSubscribe<Response<T>>() { | |
@Override | |
public void call(Subscriber<? super Response<T>> subscriber) { | |
if (isThereInternetConnection()) { | |
Call<T> request = endpoint.call(data); | |
try { | |
Response<T> response = request.execute(); | |
int code = response.code(); | |
if (response.isSuccess()) { |
This file contains hidden or 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
-module(bot). | |
-behaviour(gen_server). | |
-export([start_link/0]). | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). | |
start_link() -> | |
gen_server:start_link({local,?MODULE},?MODULE, [], []). | |
init([]) -> {ok, []}. |
This file contains hidden or 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
public class PersistentStore { | |
private static final String SHARED_PREFERENCES = "tvtag_PS_ATGAR"; | |
private static final String SYNC = "sync"; | |
private static SharedPreferences getSharedPreferences(Context context) { | |
return context.getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); | |
} | |
private static SharedPreferences.Editor getSharedPreferencesEditor(Context context) { |
This file contains hidden or 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 com.itv.util; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
public class DataDelegateAdapter<T> extends BaseAdapter { | |
private DataAdapterDelegate<T> delegate; | |
private boolean shouldLoadMoreData = true; |
This file contains hidden or 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
int[][] scaleImageData(int[][] sourceData, int scaleFactor) { | |
int[][] doubleSource = new int [sourceData.length * scaleFactor][soureData[0].length * scaleFactor]; | |
for(int i = 0; i < sourceData.length; i++){ | |
for(int j = 0; j < sourceData[i].length; j++){ | |
for(int k = 0; k < scaleFactor; k++){ | |
for(int z = 0; z < scaleFactor ; z++) | |
doubleSource[i * scaleFactor + k][j * scaleFactor +z] = sourceData[i][j]; | |
This file contains hidden or 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
new AsyncTask<Void, Void, String>() { | |
@Override | |
public String doInBackground(Void... params) { | |
String result = new String(); | |
return result; | |
} | |
@Override | |
public void onPostExecute(String response) { | |
} |
NewerOlder