Skip to content

Instantly share code, notes, and snippets.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@taghassan54
taghassan54 / main.dart
Last active October 26, 2023 04:10
clean architecture
void main() async {
Login auth = Login(new AuthRepoImpl());
User? loginResult =
await auth.call(LoginModel(userName: "taghassan54", userPass: "123456"));
print(loginResult?.id);
print(loginResult?.user);
}
//abstract USECASE
abstract class UseCase<Type, Param> {
import 'package:dio/dio.dart';
final Dio client = Dio();
client.interceptors.add(kDebugMode
? LogInterceptor(
request: true,
responseBody: true,
requestHeader: true,
@taghassan54
taghassan54 / methodchannel.kt
Created January 8, 2022 19:41 — forked from ritshpatidar/methodchannel.kt
Connecting Java or Kotlin to Flutter using MethodChannel
package com.example.ourproject
import android.os.Bundle
import io.flutter.plugin.common.MethodChannel
import android.widget.Toast
import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
private val CHANNEL = "ourproject.sendstring"
@taghassan54
taghassan54 / gist:374be3f3ec77e6182bcfa2099879575c
Created October 23, 2021 21:40 — forked from isimmons/gist:8202227
Truncate tables with foreign key constraints in a Laravel seed file.

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@taghassan54
taghassan54 / calendar-javascript-library.markdown
Created March 28, 2019 21:33
Calendar Javascript Library