Skip to content

Instantly share code, notes, and snippets.

View just1and0's full-sized avatar
🏠
working from home!

Oluwatobi Shokunbi just1and0

🏠
working from home!
View GitHub Profile
var pin = Math.floor(1000 + Math.random() * 9000);
return pin
@just1and0
just1and0 / Request.php
Created May 22, 2019 20:27
Make POST, GET, PUT request in php
function CallAPI($method, $url, $data = false)
{
$curl = curl_init();
switch ($method)
{
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($data)
function CounterFunction() {
const [count, setCount] = React.useState(1);
return (
<div>
<p>Count: {count}</p>
<button onClick={() =>
setCount(count + 1)}
>Increase</button>
</div>
);
class CounterClass extends React.Component {
constructor(props) {
super(props);
this.state = { count: 1 };
}
render() {
return <div>
<p>Count: {this.state.count}</p>
<button onClick={() => this.setState({
@just1and0
just1and0 / expo_image_upload.js
Created April 3, 2019 08:44
upload images in expo using firebase
import React from 'react';
import { Text, View, TouchableOpacity, } from 'react-native';
import firebase from "firebase";
import { ImagePicker, Permissions } from 'expo';
class Upload extends React.Component {
constructor(props) {
.centerDiv{
top: 50%;
left: 50%;
transform: translate(-50%, 50%);
}
@just1and0
just1and0 / media-query.css
Created March 13, 2019 11:13 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@just1and0
just1and0 / uid-generator.js
Created February 17, 2019 17:41
simple unique uid generator
uid(){
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
@just1and0
just1and0 / nigerian-banks.js
Last active June 11, 2019 09:29
πŸ‡³πŸ‡¬πŸ’³ List of currently authorized commercial banks in Nigeria, as listed by CBN (January 2019) - nigerian-banks.js
return [
"Access Bank",
"Citibank Nigeria",
"Diamond Bank",
"Ecobank Nigeria",
"Fidelity Bank",
"First Bank Nigeria",
"First City Monument Bank",
"Guaranty Trust Bank",
"Heritage Banking Company",
@just1and0
just1and0 / fade-title-up-and-down-onscroll.html
Created December 28, 2017 12:01 — forked from stephenscaff/fade-title-up-and-down-onscroll.html
Fade hero title down + up on scroll with a touch of jquery and CSS keyframes. No keyframe support? Loser. But, no worries, just fade title in and out with animate opacity then.
<!DOCTYPE html>
<head>
<!-- CSS
================================================== -->
<style>
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;