James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"
$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{| <?php | |
| /** | |
| * UUID class | |
| * | |
| * The following class generates VALID RFC 4122 COMPLIANT | |
| * Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
| * | |
| * UUIDs generated validates using OSSP UUID Tool, and output | |
| * for named-based UUIDs are exactly the same. This is a pure | |
| * PHP implementation. |
| document.getElementsByTagName('button')[0].onclick = function () { | |
| scrollTo(document.body, 0, 1250); | |
| } | |
| function scrollTo(element, to, duration) { | |
| var start = element.scrollTop, | |
| change = to - start, | |
| currentTime = 0, | |
| increment = 20; | |
| // Get The Page ID You Need | |
| get_option( 'woocommerce_shop_page_id' ); | |
| get_option( 'woocommerce_cart_page_id' ); | |
| get_option( 'woocommerce_checkout_page_id' ); | |
| get_option( 'woocommerce_pay_page_id' ); | |
| get_option( 'woocommerce_thanks_page_id' ); | |
| get_option( 'woocommerce_myaccount_page_id' ); | |
| get_option( 'woocommerce_edit_address_page_id' ); | |
| get_option( 'woocommerce_view_order_page_id' ); | |
| get_option( 'woocommerce_terms_page_id' ); |
| <?php | |
| global $wpdb; | |
| $wpdb->insert( | |
| $wpdb->postmeta, | |
| array( | |
| 'post_id' => get_the_ID(), | |
| 'meta_key' => 'name', | |
| 'meta_value' => 'John' | |
| ), |
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
| # force HTTPS and www. | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR] | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L] | |
| # alternative way | |
| RewriteCond %{HTTP_HOST} !^$ | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] |
| var App = {}; | |
| var addRoutes = function () { | |
| $NB.addRoute('/books/:id', function (params) { | |
| console.log('Route is ', params.Title, params.id); | |
| }, 'books'); | |
| $NB.addRoute('/:category/:id', function (params) { | |
| console.log('Route is ', params.Title, params.category, params.id); | |
| }, 'category'); |
| const assert = require('assert') | |
| function getAnimals(fetch, id) { | |
| return fetch('http://api.animalfarmgame.com/animals/' + id) | |
| .then(response => response.json()) | |
| .then(data => data.results[0]) | |
| } | |
| describe('getAnimals', () => { | |
| it('calls fetch with the correct url', () => { |