Skip to content

Instantly share code, notes, and snippets.

View trunghieuvn's full-sized avatar

Hiếu trunghieuvn

View GitHub Profile
@trunghieuvn
trunghieuvn / map error
Created June 11, 2018 18:15
map error
Syncing files to device iPhone X...
flutter: ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
flutter: The following assertion was thrown while handling a gesture:
flutter: type '_BroadcastSubscription<Location>' is not a subtype of type 'StreamSubscription<Null>'
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new
flutter:
@trunghieuvn
trunghieuvn / map error
Created June 11, 2018 18:15
map error
Syncing files to device iPhone X...
flutter: ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
flutter: The following assertion was thrown while handling a gesture:
flutter: type '_BroadcastSubscription<Location>' is not a subtype of type 'StreamSubscription<Null>'
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new
flutter:
@trunghieuvn
trunghieuvn / Demo map
Created June 11, 2018 21:29
Demo map
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:map_view/map_view.dart';
import 'dart:io' show Platform;
///This API Key will be used for both the interactive maps as well as the static maps.
///Make sure that you have enabled the following APIs in the Google API Console (https://console.developers.google.com/apis)
/// - Static Maps API
/// - Android Maps API
@trunghieuvn
trunghieuvn / stepper
Created July 2, 2018 13:52
flutter stepper
import 'package:flutter/material.dart';
//import 'package:validate/validate.dart'; //for validation
void main() {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
@trunghieuvn
trunghieuvn / cube
Created September 17, 2018 02:41
DirectX 3d Cube
static const VertexPositionColor cubeVertices[] =
{
{XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT3(0.0f, 0.0f, 0.0f)},
{XMFLOAT3(-0.5f, -0.5f, 0.5f), XMFLOAT3(0.0f, 0.0f, 1.0f)},
{XMFLOAT3(-0.5f, 0.5f, -0.5f), XMFLOAT3(0.0f, 1.0f, 0.0f)},
{XMFLOAT3(-0.5f, 0.5f, 0.5f), XMFLOAT3(0.0f, 1.0f, 1.0f)},
{XMFLOAT3( 0.5f, -0.5f, -0.5f), XMFLOAT3(1.0f, 0.0f, 0.0f)},
{XMFLOAT3( 0.5f, -0.5f, 0.5f), XMFLOAT3(1.0f, 0.0f, 1.0f)},
{XMFLOAT3( 0.5f, 0.5f, -0.5f), XMFLOAT3(1.0f, 1.0f, 0.0f)},
{XMFLOAT3( 0.5f, 0.5f, 0.5f), XMFLOAT3(1.0f, 1.0f, 1.0f)},
@trunghieuvn
trunghieuvn / check null
Created November 9, 2018 15:14
check null
var anim = this.getComponent(cc.Animation);
if(anim != null)
{
anim.play();
var anim = this.getComponent(cc.Animation);
var animState = anim.play("TigerRun");
// accelerate the playing speed of animation
animState.speed = 2;
if (!cc.runtime) {
// runtime not support dragonbones.
var NORMAL_ANIMATION_GROUP = "normal";
var AIM_ANIMATION_GROUP = "aim";
var ATTACK_ANIMATION_GROUP = "attack";
var JUMP_SPEED = -20;
var NORMALIZE_MOVE_SPEED = 3.6;
var MAX_MOVE_SPEED_FRONT = NORMALIZE_MOVE_SPEED * 1.4;
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@echo off
title %~nx0
color 2
REM mode con lines=18 cols=70
set GameEngine=%cd%
set DIR=%cd%
set PRJ_WIN32_SLN="Project/Demo3D.sln"
set BUILD_TOOL="C:\Program Files (x86)\MSBuild\14.0\Bin"
@trunghieuvn
trunghieuvn / API controller
Created January 23, 2019 07:15
Controller.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
class APIController extends Controller
{