Skip to content

Instantly share code, notes, and snippets.

View nguyenvanduocit's full-sized avatar
🦁
On codecation

Duoc Nguyen nguyenvanduocit

🦁
On codecation
View GitHub Profile
@nguyenvanduocit
nguyenvanduocit / MusicPlayer_AudioPlayer.vue
Created September 6, 2019 03:46
SoundWave and AudioPlayer Animation
<template>
<audio
ref="audio"
src="/audio/magical.mp3"
preload="auto"
loop
@canplaythrough="audioLoaded"
>
<p>If you are reading this, it is because your browser does not support the audio element.</p>
</audio>
@nguyenvanduocit
nguyenvanduocit / docker-compose.yaml
Created July 11, 2019 01:46
Docker compose file for owncloud
version: '2.1'
volumes:
files:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/Users/duocnguyen/Tmp/owncloud-docker-server/files'
mysql:
class GradientButton extends StatelessWidget {
static const Color loginGradientStart = const Color(0xFFfbab66);
static const Color loginGradientEnd = const Color(0xFFf7418c);
static const LinearGradient primaryGradient = const LinearGradient(
colors: [loginGradientStart, loginGradientEnd],
stops: [0.0, 1.0],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
);
// interviewer: what will the following code output?
const arr = [10, 12, 15, 21];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', element: ' + arr[i]);
}, 3000);
}
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
import 'package:flame/flame.dart';
import 'package:flutter/material.dart';
class ButtonStyle {
final Color topColor;
final Color backColor;
const ButtonStyle({@required this.topColor, @required this.backColor});
static const DEFAULT = const ButtonStyle(
topColor: const Color(0xFF45484c),
backColor: const Color(0xFF191a1c)
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flame/flame.dart';
class ButtonStyle {
final Color topColor;
final Color backColor;
const ButtonStyle({@required this.topColor, @required this.backColor});
static const DEFAULT = const ButtonStyle(
topColor: const Color(0xFF45484c),
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>
<body>
<header class="header">
<div class="header__left">
<a class="header__logo"
check_admin_referer('update-post_' . $post_id);
$post_id = edit_post();
// Session cookie flag that the post was saved
if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {
setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() );
}
redirect_post($post_id); // Send user on their way while we keep working
function hcf_save( $post_id ) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
if ( $parent_id = wp_is_post_revision( $post_id ) ) {
$post_id = $parent_id;
}
$field_list = [
'hcf_author',
'hcf_published_date',