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 validation from 'validate.js' | |
export default function validate(fieldName, value) { | |
var constraints = { | |
email: { | |
presence: true, | |
format: { | |
pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, | |
message: 'Invalid email id', | |
} |
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
//Set Variables | |
$button-white: #ffffff; | |
$button-green: #44ca00; | |
$button-green-dark: #369a12; | |
$button-blue: #a6d1f9; | |
$button-blue-dark: #14283e; | |
$button-gray: #eeeeee; | |
$button-red: #9e0b0f; | |
//Create Array |
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
class ClassFactory | |
{ | |
function __construct($namespace = '') | |
{ | |
$this->namespace = $namespace; | |
} | |
public function make($source) | |
{ | |
$name = $this->namespace . '\\' . $source; |
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 Soap { | |
private static final String BASE_URL = "base_url"; | |
private static String RESULT_OK = "200"; | |
private static String getAbsiluteURL(String postFixUrl) { | |
return BASE_URL + postFixUrl; | |
} | |
private static String getConnectionErrorResponse(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
import React, { Component } from 'react' | |
import { Redirect } from 'react-router' | |
export default class ContactForm extends Component { | |
constructor () { | |
super(); | |
this.state = { | |
fireRedirect: false | |
} | |
} |
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 axios from 'axios'; | |
class Service { | |
constructor() { | |
let service = axios.create({ | |
headers: {csrf: 'token'} | |
}); | |
service.interceptors.response.use(this.handleSuccess, this.handleError); | |
this.service = service; | |
} |
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
/** | |
* Axios Request Wrapper | |
* --------------------- | |
* | |
* @author Sheharyar Naseer (@sheharyarn) | |
* @license MIT | |
* | |
*/ | |
import axios from 'axios' |
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 from "react-native"; | |
import Dimensions from 'Dimensions'; | |
// Precalculate Device Dimensions for better performance | |
const x = Dimensions.get('window').width; | |
const y = Dimensions.get('window').height; | |
// Calculating ratio from iPhone breakpoints | |
const ratioX = x < 375 ? (x < 320 ? 0.75 : 0.875) : 1 ; | |
const ratioY = y < 568 ? (y < 480 ? 0.75 : 0.875) : 1 ; |
NewerOlder