Skip to content

Instantly share code, notes, and snippets.

<?php
$link = mysqli_connect("localhost", "newuser", "password", "proj1");
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// Attempt select query execution
$q = $_GET['q'];
$sql = "SELECT * FROM t2 WHERE f1 = '$q'";
export const getDataSearch = ({ fulldata }) => {
return {
type: GET_DATA_SEARCH,
payload: fulldata
}
}
export const searchChanged = (text) => {
return {
type: SEARCH_TEXT,
payload: text
export const contains = ({ name, date, place }, query) => {
if (
name.toLowerCase().includes(query) ||
date.toLowerCase().includes(query) ||
place.toLowerCase().includes(query) ||
name.includes(query) ||
date.includes(query) ||
place.includes(query)
) {
return true
import {
searchChanged,
contains,
getDataSearch
} from '../../actions/searchActions';
import _ from 'lodash';
class Search extends React.component {
// function yang akan dipanggil ketika TextInput diisi
handleSearch = (text) => {
import React from 'react';
import { createStore } from "redux";
import { Provider } from "react-redux";
import reducer from './src/Reducer/index';
import TextInputChecker from './src/Component/TextInputChecker';
class App extends React.Component {
render() {
return (
import { PASSWORD_CHANGED } from './types';
export const passwordChecker = (text) => {
return {
type: PASSWORD_CHANGED,
payload: text
}
}
import { PASSWORD_CHANGED } from '../Action/types';
const initialState = { password: '' }
export default function textInputCheckerReducer (state= initialState, action){
console.log(action);
switch(action.type) {
case PASSWORD_CHANGED:
return { ...state, password: action.payload }
default:
return state
import { combineReducers } from "redux";
import textInputCheckerReducer from '../Reducer/TextInputCheckerReducer';
export default combineReducers({
textInputCheckerReducer
})
import React from 'react';
import { View, TextInput, Text, StyleSheet, TouchableOpacity } from 'react-native';
import { connect } from "react-redux";
import { passwordChecker } from '../Action/TextInputCheckerAction';
class TextInputChecker extends React.Component {
checker(){
const passwordParam = "^(?=.{5,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$"
@alashstein
alashstein / index.js
Created September 25, 2018 20:52 — forked from AlexBrasileiro/index.js
ShareYourFeedback
// inspiration: https://dribbble.com/shots/4370657-Share-Your-Feedback
import React, { Component, Fragment } from "react";
import { Animated, StyleSheet, Text, View, TouchableOpacity, Dimensions, Platform, Easing, TextInput, KeyboardAvoidingView, Image } from "react-native";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const { width: windowWidth } = Dimensions.get('window');
const Icon = (props) => <FontAwesome5 {...props} />