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');

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
@caothetoan
caothetoan / regex-japanese.txt
Created October 31, 2019 02:35 — forked from terrancesnyder/regex-japanese.txt
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@caothetoan
caothetoan / JapaneseRegex.js
Created October 31, 2019 02:34 — forked from ryanmcgrath/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@caothetoan
caothetoan / CKEditor.vue
Created May 23, 2019 23:56 — forked from pi0/CKEditor.vue
CKEditor
<!-- Based on https://github.com/dangvanthanh/vue-ckeditor -->
<template>
<div class="ckeditor">
<textarea :id="id" :value="value"></textarea>
</div>
</template>
<style scoped>
.ckeditor {