Skip to content

Instantly share code, notes, and snippets.

View javiergarzac's full-sized avatar
🌵

Javier Garza javiergarzac

🌵
View GitHub Profile
export default function HelloWorld() {
return <div>Hello worls</div>
}
@javiergarzac
javiergarzac / github-oauth3-client.php
Last active June 10, 2018 18:33
Simple PHP example of using Github's OAuth 3 API
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
define('API_NAME', '');
$authorizeURL = 'https://github.com/login/oauth/authorize';
$tokenURL = 'https://github.com/login/oauth/access_token';
$apiURLBase = 'https://api.github.com/';
session_start();
const checkDivisor = num => {
const stringifyNum = num.toString();
let count = 0;
for (let i = 0; i < stringifyNum.length; i += 1) {
if(num % stringifyNum[i] === 0) {
count += 1;
}
}
return count;