Skip to content

Instantly share code, notes, and snippets.

@itwondersteam
itwondersteam / PageView-slide-show.dart
Created August 14, 2020 10:51
flutter slide show using PageView
class ViewPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => _ViewPageState();
}
class _ViewPageState extends State<ViewPage> {
var imgList = [
'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2877516247,37083492&fm=26&gp=0.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1582796218195&di=04ce93c4ac826e19067e71f916cec5d8&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F344fda8b47808261c946c81645bff489c008326f15140-koiNr3_fw658'
];
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SingleSlideAnimation extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: SafeArea(child: Scaffold(body: buildBody())),
);
@itwondersteam
itwondersteam / main.dart
Last active January 13, 2021 04:15
Flutter layout example - Good Tutorial 01
import 'package:flutter/material.dart';
void main() => runApp(HomePage());
const red = Colors.red;
const green = Colors.green;
const blue = Colors.blue;
const big = const TextStyle(fontSize: 30);
//////////////////////////////////////////////////
export interface IUser {
id?: number;
email: string;
first_name: string;
last_name: string;
avatar: string;
}
export class UserDTO implements IUser{
id?: number;
// /src/ui/shims-provider.d.ts
/* eslint-disable @typescript-eslint/interface-name-prefix */
import { IProvider } from '@/services'
declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
services?: IProvider
}
}
@itwondersteam
itwondersteam / study.php
Last active March 4, 2021 11:21
laravel tap
// https://laravel-news.com/using-sanctum-to-authenticate-a-react-spa
// The tap command is a short-hand way of saying “create the guard, then pass it to the closure in the second argument;
// then return the guard”. Let’s look at createGuard:
$auth->extend('sanctum', function ($app, $name, array $config) use ($auth) {
return tap($this->createGuard($auth, $config), function ($guard) {
$this->app->refresh('request', $guard, 'setRequest');
});
});
@itwondersteam
itwondersteam / coming-soon.html
Created April 6, 2021 10:05
coming soon html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">

Laravel Str Generate a more truly "random" alpha-numeric string.

    public static function random($length = 16)
    {
        $string = '';

        while (($len = strlen($string)) < $length) {
            $size = $length - $len;
@itwondersteam
itwondersteam / css-outline.js
Created May 31, 2021 21:10
css outline bookmarklet
// https://gist.github.com/addyosmani/fd3999ea7fce242756b1
window.iwShowOutline = !!!window.iwShowOutline;
[].forEach.call(document.querySelectorAll("*"),function(a){
if (window.iwShowOutline) a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)
else a.style.outline='initial'
})
@itwondersteam
itwondersteam / a2dp.py
Created November 8, 2021 09:39 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware