Skip to content

Instantly share code, notes, and snippets.

@ngoluuduythai
ngoluuduythai / index.html
Created May 23, 2023 06:32
Night && Day Toggle ☀️/🌙 [Completed It!]
<div class="controls">
<label for="sync">Sync &lt;body&gt;</label>
<input id="sync" type="checkbox"/>
</div>
<button class="toggle" aria-pressed="false" title="Toggle Dark Mode">
<span class="toggle__content">
<svg aria-hidden=true class="toggle__backdrop" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 290 228">
<g class="clouds">
<path fill="#D9D9D9" d="M335 147.5c0 27.89-22.61 50.5-50.5 50.5a50.78 50.78 0 0 1-9.29-.853c-2.478 12.606-10.595 23.188-21.615 29.011C245.699 243.749 228.03 256 207.5 256a50.433 50.433 0 0 1-16.034-2.599A41.811 41.811 0 0 1 166 262a41.798 41.798 0 0 1-22.893-6.782A42.21 42.21 0 0 1 135 256a41.82 41.82 0 0 1-19.115-4.592A41.84 41.84 0 0 1 88 262c-1.827 0-3.626-.117-5.391-.343C74.911 270.448 63.604 276 51 276c-23.196 0-42-18.804-42-42s18.804-42 42-42c1.827 0 3.626.117 5.391.343C64.089 183.552 75.396 178 88 178a41.819 41.819 0 0 1 19.115 4.592C114.532 176.002 124.298 172 135 172a41.798 41.798 0 0 1 22.893 6.782 42.066 42.066 0 0 1 7.239-.773C174.137
@ngoluuduythai
ngoluuduythai / main.dart
Created October 25, 2022 02:11
forlorn-toast-0841
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
pub fn spawn_actor(supervisor: &SupervisorRef, db_name: String, request_db: Value) {
supervisor
.children(move |children| {
children
.with_redundancy(1)
.with_distributor(Distributor::named("spawn_actor"))
.with_exec(move |ctx: BastionContext| {
let db_rs = sled::open(format!("src/database/{}", &db_name));
let request_db = request_db.clone();
let db_name = db_name.clone();
@ngoluuduythai
ngoluuduythai / Playground.hs
Last active March 24, 2021 18:02
Plutus Playground Smart Contract
-- This is a starter contract, based on the Game contract,
-- containing the bare minimum required scaffolding.
--
-- What you should change to something more suitable for
-- your use case:
-- * The MyDatum type
-- * The MyMyRedeemerValue type
--
-- And add function implementations (and rename them to
-- something suitable) for the endpoints:
@ngoluuduythai
ngoluuduythai / Playground.hs
Last active March 24, 2021 04:23
Plutus Playground Smart Contract
import qualified Data.Text as T
import Language.Plutus.Contract hiding (when)
import Language.PlutusTx.Prelude
import Playground.Contract
-- | A 'Contract' that logs a message.
-- public Contract<BlockchainActions, T.Text, void) hello(){
-- return logInfo(@string "Hello, world");
-- }
-- T.Text is error
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override

Keybase proof

I hereby claim:

  • I am ngoluuduythai on github.
  • I am ngoluuduythai (https://keybase.io/ngoluuduythai) on keybase.
  • I have a public key ASDU9PdRKTKvI_SC6ECVYG9IlYPliobLML49iC-CP_nBewo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ngoluuduythai on github.
  • I am ngoluuduythai (https://keybase.io/ngoluuduythai) on keybase.
  • I have a public key ASDU9PdRKTKvI_SC6ECVYG9IlYPliobLML49iC-CP_nBewo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ngoluuduythai on github.
  • I am ngoluuduythai (https://keybase.io/ngoluuduythai) on keybase.
  • I have a public key ASDU9PdRKTKvI_SC6ECVYG9IlYPliobLML49iC-CP_nBewo

To claim this, I am signing this object:

@ngoluuduythai
ngoluuduythai / robot.cpp
Last active August 29, 2015 14:26 — forked from zhezheng/robot.cpp
Elderly Fall Detection Using Web Camera and Mobile Robot
#include <stdio.h>
#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <opencv/cxcore.h>
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <std_msgs/String.h>
IplImage* imgTracking;