Skip to content

Instantly share code, notes, and snippets.

@caothetoan
caothetoan / template.yaml
Created May 9, 2023 11:16 — forked from em-shea/template.yaml
An example SAM template that creates a DynamoDB table, a Lambda function that writes to DynamoDB, and a CloudWatch Event trigger
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An app that includes a DynamoDB table, Lambda function that writes to DynamoDB, and CloudWatch Event trigger
Resources:
LambdaWriteToDynamoDB:
# A function that writes to a DynamoDB table on a schedule
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: LambdaWriteToDynamoDB
@caothetoan
caothetoan / HttpClient.cs
Created April 14, 2022 03:04 — forked from dfch/HttpClient.cs
HttpClient and how to use Headers, Content-Type and PostAsync
// HttpClient and how to use Headers, Content-Type and PostAsync
// http://d-fens.ch/2014/04/12/httpclient-and-how-to-use-headers-content-type-and-postasync/
// Copyright 2014-2015 Ronald Rink, d-fens GmbH
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
@caothetoan
caothetoan / ID.js
Last active November 5, 2020 10:06
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
@caothetoan
caothetoan / responsive-voice.js
Created August 11, 2020 16:37 — forked from anchetaWern/responsive-voice.js
responsive-voice.js
//Look for other responsivevoice instances
/*if (window.parent != null) {
var iframes = window.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
//iframes[i].style.width = "300px"
}
}*/
if (typeof responsiveVoice != 'undefined') {
console.log('ResponsiveVoice already loaded');
USE database_name;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE database_name
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (database_name_Log, 1);
GO
-- Reset the database recovery model.
import random
import tkinter as tk
from tkinter import ttk
import tkinter.messagebox
root = tk.Tk()
""" *** Memory *** """
board2 = [["0", "1", "2"], ["3", "4", "5"], ["6", "7", "8"]]
a = ["X"]
@caothetoan
caothetoan / settings.json
Created June 25, 2020 01:29
Visual Code Setting File
{
"git.autofetch": true,
"git.enableSmartCommit": true,
"vscode_custom_css.imports": ["file:///F:/vscode-custom.css"],
"vscode_custom_css.policy": true,
"workbench.iconTheme": "vscode-icons",
"vsicons.dontShowNewVersionMessage": true,
"git.confirmSync": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"extensions.ignoreRecommendations": true,

Web Speech Synthesis Demo

A basic use of web speech synthesis.

Support in Chrome Canary/Dev Channel and Safari

A Pen by Matt West on CodePen.

License.

@caothetoan
caothetoan / VCurrencyField.vue
Created March 30, 2020 03:56 — forked from Christilut/VCurrencyField.vue
Vuetify Currency Field
<template lang="pug">
v-text-field(
ref='field',
:prefix='prefix',
v-model='model',
@focus='onFocus',
@keyup='onKeyUp',
:error-messages='errorMessages',
v-bind='$attrs',
@change='onChange'
@caothetoan
caothetoan / gist:30ba5cf16251e355799ddf6a4963d7fa
Created March 11, 2020 04:54
Visual Studio 2019 Product Key
Visual Studio 2019 Enterprise
BF8Y8-GN2QH-T84XB-QVY3B-RC4DF
Visual Studio 2019 Professional
NYWVH-HT4XC-R2WYW-9Y3CM-X4V3Y