Skip to content

Instantly share code, notes, and snippets.

View chadidi's full-sized avatar
🌴
On vacation

Abdellah Chadidi chadidi

🌴
On vacation
View GitHub Profile
@chadidi
chadidi / Remix CodePen Challenge.markdown
Created June 16, 2015 01:20
Remix CodePen Challenge
@chadidi
chadidi / laravel.log
Created April 18, 2017 14:44
Laravel Error : Call to a member function beginTransaction() on null
[2017-04-18 14:42:50] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function beginTransaction() on null in /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:108
Stack trace:
#0 /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(92): Illuminate\Database\Connection->createTransaction()
#1 /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(192): Illuminate\Database\Connection->beginTransaction()
#2 /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(236): Illuminate\Queue\DatabaseQueue->pop('default')
#3 /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(101): Illuminate\Queue\Worker->getNextJob(Object(Illuminate\Queue\DatabaseQueue), 'default')
#4 /var/www/fevrok.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(100): Illuminate\Queue\Worker->daemon('database',
@chadidi
chadidi / flutter1.log
Created January 21, 2019 05:00
Flutter bug when sending post request
E/flutter (32582): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (32582): type 'int' is not a subtype of type 'String' in type cast
E/flutter (32582): #0 CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:286:25)
E/flutter (32582): #1 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:370:8)
E/flutter (32582): #2 CastMap.forEach (dart:_internal/cast.dart:285:13)
E/flutter (32582): #3 mapToQuery (package:http/src/utils.dart:17:7)
E/flutter (32582): #4 Request.bodyFields= (package:http/src/request.dart:128:17)
E/flutter (32582): #5 BaseClient._sendUnstreamed (package:http/src/base_client.dart:163:17)
E/flutter (32582): <asynchronous suspension>
E/flutter (32582): #6 BaseClient.post (package:http/src/base_client.dart:54:7)
Future<Map<String, dynamic>> createActivity(activityData) async {
print('creating activity...');
var url = "https://www.tapographics.com/api/activity";
print(activityData);
final http.Response response =
await http.post(Uri.encodeFull(url), body: json.encode(activityData));
// debug
@chadidi
chadidi / hyper-settings
Created May 14, 2019 00:49
Abdellah Chadidi Hyper settings
{}
{
"debug": {
"database": {
"total": 166,
"items": [
{
"connection": "mysql",
"query": "select count(*) as aggregate from `posts` left join `likes` on `posts`.`id` = `likes`.`likable_id` and `likes`.`likable_type` = 'posts' left join `comments` on `posts`.`id` = `comments`.`commentable_id` and `comments`.`commentable_type` = 'posts' where `posts`.`deleted_at` is null group by `posts`.`id`;",
"time": 6.89
},
[2020-06-03 21:09:38] local.INFO: select count(*) as aggregate from `posts` left join `likes` on `posts`.`id` = `likes`.`likable_id` and `likes`.`likable_type` = ? left join `comments` on `posts`.`id` = `comments`.`commentable_id` and `comments`.`commentable_type` = ? where `posts`.`deleted_at` is null group by `posts`.`id` ["posts","posts"]
[2020-06-03 21:09:38] local.INFO: select posts.*, count(likes.id) + count(comments.id) as total_count from `posts` left join `likes` on `posts`.`id` = `likes`.`likable_id` and `likes`.`likable_type` = ? left join `comments` on `posts`.`id` = `comments`.`commentable_id` and `comments`.`commentable_type` = ? where `posts`.`deleted_at` is null group by `posts`.`id` order by `total_count` desc limit 15 offset 0 ["posts","posts"]
[2020-06-03 21:09:38] local.INFO: select * from `users` where `users`.`id` in (4, 1) and `users`.`deleted_at` is null
[2020-06-03 21:09:38] local.INFO: select * from `pages` where `pages`.`id` in (1, 2) and `pages`.`deleted_at` is null
[2020-06
[2020-06-03 21:17:22] local.INFO: select posts.*, count(likes.id) as total_likes, count(comments.id) as total_comments, count(likes.id) + count(comments.id) as total_count from `posts` left join `likes` on `posts`.`id` = `likes`.`likable_id` and `likes`.`likable_type` = ? left join `comments` on `posts`.`id` = `comments`.`commentable_id` and `comments`.`commentable_type` = ? where `posts`.`deleted_at` is null group by `posts`.`id` order by `total_count` desc ["posts","posts"]
[2020-06-03 21:17:22] local.INFO: select count(*) as aggregate from `comments` where `comments`.`commentable_id` = ? and `comments`.`commentable_id` is not null and `comments`.`commentable_type` = ? and `comments`.`deleted_at` is null [1,"posts"]
[2020-06-03 21:17:22] local.INFO: select count(*) as aggregate from `users` inner join `likes` on `users`.`id` = `likes`.`user_id` where `likes`.`likable_id` = ? and `likable_type` = ? and `likes`.`deleted_at` is null and `users`.`deleted_at` is null [1,"posts"]
[2020-06-03 21:17:22] local.IN
@chadidi
chadidi / posts raw 2
Last active June 3, 2020 21:21
posts without eager loads and appends
[2020-06-03 21:20:43] local.INFO: select posts.*, count(likes.id) + count(comments.id) as total_count from `posts` left join `likes` on `posts`.`id` = `likes`.`likable_id` and `likes`.`likable_type` = ? left join `comments` on `posts`.`id` = `comments`.`commentable_id` and `comments`.`commentable_type` = ? where `posts`.`deleted_at` is null group by `posts`.`id` order by `total_count` desc ["posts","posts"]
{
"basics": {
"name": "Abdellah Chadidi",
"picture": "https://avatars3.githubusercontent.com/u/9916806?v=4",
"label": "@fevrok",
"headline": "Founder @fevrok and developer @AirbitUK, sometimes contributer to @LaravelArab and other open source projects...\r\n",
"summary": "test",
"website": "chadidi.dev",
"blog": null,
"yearsOfExperience": 5,