Skip to content

Instantly share code, notes, and snippets.

Avatar
🔬
Building @pestphp

Nuno Maduro nunomaduro

🔬
Building @pestphp
View GitHub Profile
View rector.yaml
# rector.yaml
parameters:
sets:
- 'action-injection-to-constructor-injection'
- 'array-str-functions-to-static-call'
- 'celebrity'
- 'doctrine'
- 'phpstan'
- 'phpunit-code-quality'
- 'solid'
View example.ts
type ConstructorOf<TObject> = new (...input: any[]) => TObject;
class User { readonly name: string = 'Foo'; }
type HasGetName = { readonly getName: () => string; };
const getName = <TUser extends ConstructorOf<User>>(Base: TUser) => {
return class extends Base implements HasGetName {
public getName() { return this.name; }
};
View errors.js
Vue warn]: Property or method "searchClient" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
(found in <Root>)
warn @ app.js:68765
warnNonPresent @ app.js:70178
has @ app.js:70223
(anonymous) @ VM153:3
Vue._render @ app.js:71676
updateComponent @ app.js:72192
get @ app.js:72603
View dom.html
<body>
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div id="app"><div class="ais-InstantSearch"></div></div>
<script src="/js/app.js"></script>
<script>
View guhiop.blade.php
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div id="app">
<!-- In a default Laravel app, Vue will render inside an #app div -->
<ais-instant-search
:search-client="searchClient"
index-name="{{ (new App\User)->searchableAs() }}"
@nunomaduro
nunomaduro / upgrade-guide.md
Last active Mar 27, 2019
Python 2.0's upgrade-guide
View upgrade-guide.md

Upgrading To 2.0.0 From 1.20.0

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the API Client only a portion of these changes may actually affect your application.

Upgrade your algoliasearch dependency to >=2.0,<3.0 using pip:

pip install --pre algoliasearch 
View README.md

This Pull Request introduces the upcoming Algolia API Client Python v2.

Preface

  • Follows 100% of the API Client v2 specs, just like PHP v2, c# v2: contains waitable response objects, up-to-date retry strategy, replace_all_objects,clear_objects, and more!

  • Supports Python: 2.7 🥳, 3.4, 3.5, 3.6, and 3.7.

  • Strong test suite, 100% test coverage on unittest (tests === 30secs locally! 🏎), flake8 (linter), and mypy (static-analysis) to ensure the quality of the code.

View scout_extended_facades_client.php
<?php
use Algolia\ScoutExtended\Facades\Algolia;
$client = Algolia::client();
$apiKeys = $client->listApiKeys();
$indices = $client->listIndices();
$client->copyIndex('indexNameSrc', 'indexNameDest');
$client->moveIndex('indexNameSrc', 'indexNameDest');
View scout_extended_facades_analytics.php
<?php
use Algolia\ScoutExtended\Facades\Algolia;
$analytics = Algolia::analytics();
$test = $analytics->getABTest('a-unique-identifier');
// ...
View scout_extended_facade_client.php
<?php
use Algolia\ScoutExtended\Facades\Algolia;
$client = Algolia::client();
$apiKeys = $client->listApiKeys();
$indices = $client->listIndices();
$client->copyIndex('indexNameSrc', 'indexNameDest');
$client->moveIndex('indexNameSrc', 'indexNameDest');