View rotate.swift
@objc func deviceRotated(){
if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
navBar?.isHidden = true
webView?.frame = CGRect(x: 0, y: 0, width: view.frame.size.width, height: view.frame.size.height)
}
View examplePinViewScreen.js
import React, { Component } from 'react';
import { View } from 'react-native';
import PinView from 'react-native-pin-view'
type Props = {};
export default class Master extends Component<Props> {
constructor(props) {
super(props);
this.onFailure = this.onFailure.bind(this);
this.onSuccess = this.onSuccess.bind(this);
View pinView.js
import PinView from 'react-native-pin-view'
// ...
<PinView
password={ [1, 3, 5, 7, 9] }
onSuccess={ ()=>{alert("SUCCESS")} }
onFailure={ ()=>{alert("FAILURE")} }
/>
View gettingProvider
/**
* Get provider name.
* @return Name of best suiting provider.
* */
String getProviderName() {
LocationManager locationManager = (LocationManager) this
.getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setPowerRequirement(Criteria.POWER_LOW); // Chose your desired power consumption level.
View react-native-simple-card-view-example.js
import React, { Component } from 'react';
import {Platform,StyleSheet,Text,View,Dimensions} from 'react-native';
import { CardViewWithIcon } from "react-native-simple-card-view";
type Props = {};
export default class App extends Component<Props> {
constructor(props) {
super(props);
this.state = ({
github : 0,
}
View Node.js Mkdir
const fs = require("fs");
fs.mkdir(__dirname + "/example");
const content = "Hello World!";
fs.writeFile(__dirname + "/example/myfile.txt", content, "utf-8", function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
View Node-fetch Post (for golang rest-api)
const FormData = require('form-data');
const data = new FormData();
data.append('email', "demo@demo.com");
data.append('password', "demo123");
fetch('http://localhost:5656/', { method: 'POST', body: data })
.then(function(res) {
return res.json();
}).then(function(json) {
console.log(json);
});
View main2.db
package main
import (
"fmt"
"github.com/gorilla/mux"
_ "github.com/go-sql-driver/mysql"
"log"
"net/http"
"github.com/jinzhu/gorm"
"encoding/json"