Skip to content

Instantly share code, notes, and snippets.

View definev's full-sized avatar
💙
Fluttering

Duong Bui Dai definev

💙
Fluttering
View GitHub Profile
@definev
definev / pi.go
Created August 7, 2021 09:24
Tìm ngày tháng năm sinh trong một tỉ số Pi đầu tiên bằng Golang
package main
import (
"io"
"io/ioutil"
"log"
"net/http"
"os"
)
@definev
definev / main.c
Created August 8, 2021 14:39
Nộp bài Bùi Đại Dương
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
@definev
definev / crawl.py
Created August 9, 2021 10:04
Crawl dữ liệu thi cấp 3 Bắc Ninh 2020
import csv
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
def getSBD(sbd):
if (sbd < 10):
return f"02000{sbd}"
elif (sbd < 100):
@definev
definev / main.dart
Created December 18, 2021 12:56
Nested WIdget experiment
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@definev
definev / main.dart
Created December 18, 2021 14:25
Nested widget POC
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
final textValueProvider = StateProvider<String>((_) => "OPT_1");
final isNestedProvider = StateProvider<bool>((_) => false);
void main() {
runApp(ProviderScope(child: MyApp()));
}
@definev
definev / main.c
Created December 27, 2021 14:15
Mid-term 2021
#include <stdio.h>
#include <math.h>
#include <string.h>
char *cau_10(char mssv[])
{
int n;
printf("Nhap tham bien n: ");
scanf("%d", &n);
int m = n % 1000;
@definev
definev / HexDisplay.c
Last active March 1, 2022 14:49
Intel hex display written in C
//Intel HEX format: https://en.wikipedia.org/wiki/Intel_HEX
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Độ dài tối đa của 1 dòng
#define MAX_HEX_LENGTH 16
// Số dòng in ra tối đa trong 1 lần
#define MAX_HEX_LINE 25
@definev
definev / center.dart
Created May 24, 2022 16:02
How to center without Column
import 'package:flutter/material.dart';
main() {
runApp(
const MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox(
height: 50,
child: DecoratedBox(
@definev
definev / grid_layout.dart
Last active June 10, 2022 15:12
An grid animation.
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
void main() {
runApp(const CloneWar());
}
class CloneWar extends StatelessWidget {
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);