This file contains 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
license: gpl-3.0 | |
height: 880 | |
border: no |
This file contains 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
const apiUrl = 'https://api.github.com'; | |
var url = apiUrl + '/notifications?participating=true&access_token=MY_TOKEN'; | |
fetch(url) | |
.then(response => response.json()) | |
.then(data => { | |
console.log(data); // returned array with ONLY one notification, from where I took URL | |
}); |
This file contains 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
[{ | |
"owner": "jquery", | |
"name": "jquery" | |
}, { | |
"owner": "jashkenas", | |
"name": "backbone" | |
}, { | |
"owner": "angular", | |
"name": "angular.js" | |
}] |
This file contains 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
const apiUrl = 'https://api.github.com'; | |
export default function getInfo(TOKEN, myArrayOfRepositories) { | |
myArrayOfRepositories.forEach(function(repository) { | |
let strUrl = apiUrl + '/repos/' + repository.owner + '/' + repository.name; | |
let options = { | |
headers: { | |
// 'Content-Type': 'application/json', // OPTIONS => GET | |
// 'Content-Type': 'text/plain', // doesn't matter. Anyway OPTIONS => GET | |
'Authorization': `token ${TOKEN}` |
This file contains 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
export default function getInfo(TOKEN, myArrayOfRepositories) { | |
// let gh = new GitHub(); // unauthenticated client. Can even be used to create a anonymous gist for example | |
/* | |
// basic auth. The same as unauthenticated, this approach is limited to GET/POST requests per day. | |
let gh = new GitHub({ | |
username: 'your-user', | |
password: 'TBD', | |
}); | |
*/ |
This file contains 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
const apiUrl = 'https://api.github.com/graphql'; | |
export default function getInfo(TOKEN, myArrayOfRepositories) { | |
let queryBody = createRepositoriesQueryBody(myArrayOfRepositories); | |
let options = { | |
method: 'post', | |
headers: { | |
'Authorization': `token ${TOKEN}`, | |
'Content-Type': 'application/json' | |
}, |
This file contains 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
fragment repositoryFragment on Repository { | |
name | |
nameWithOwner | |
description | |
createdAt | |
updatedAt | |
pushedAt | |
isFork | |
forks { | |
totalCount |
This file contains 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
/** | |
* https://leetcode.com/problems/integer-to-roman/description/ | |
* https://en.wikipedia.org/wiki/Roman_numerals | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators | |
* | |
* @param {number} num | |
* @return {string} | |
*/ | |
function intToRoman(num) { | |
var base = { |
This file contains 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
#!/usr/bin/env bash | |
# # | |
# # Install main dependencies on CentOS: | |
# # Python 3.4.5, CMake 3.10.0, OpenCV 3.3.1 | |
# # Author Andrii Lundiak (landike@gmail.com) | |
# # | |
# https://github.com/ageitgey/face_recognition/issues/191 | |
# https://github.com/opencv/opencv/issues/8471 |
This file contains 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'; | |
class ChildComponent extends React.Component { | |
render() { | |
console.log('ChildComponent render'); | |
// const { childData } = this.props; | |
const { field1, field2 } = this.props; | |
return ( | |
<div style={{border: '1px dotted red', margin: '20px'}}> |