This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH="$HOME/.oh-my-zsh" | |
ZSH_THEME="spaceship" | |
plugins=(git docker docker-compose npm python emoji) | |
source $ZSH/oh-my-zsh.sh | |
# export PATH="/opt/conda/bin:$PATH" # commented out by conda initialize | |
export PATH="/snap/ngrok/current:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obtain JSON first: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account | |
// How to use: node search-agents-sdk.js | |
// SDK reference: https://googleapis.dev/nodejs/dialogflow/latest/v2.AgentsClient.html#searchAgents | |
"use strict"; | |
require('dotenv').config(); | |
// private_key and client_email are store in .env file | |
async function main() { | |
const location = "global"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obtain JSON first: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account | |
// How to use: node search-agents-json-rest.js | |
// Search agents API: https://cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.agent/search | |
require("dotenv").config(); | |
const { google } = require("googleapis"); | |
const request = require("request"); | |
async function main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol id="lst_repos"></ol> | |
<script> | |
function htmlEntities(str) { | |
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); | |
} | |
var ul = document.getElementById("lst_repos"); | |
fetch("https://api.github.com/users/dinhanhthi/starred?page=1&per_page=10000") | |
.then(response => response.json()) | |
.then(data => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="toc"> | |
<ol> | |
<li class=""><a href="#heading-1">Heading 1</a></li> | |
<li class=""><a href="#heading-2">Heading 2</a></li> | |
</ol> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Maybe on separated file (where we create DOM of result) | |
// mouse hover trigger for li | |
ulRes.querySelectorAll("li").forEach((item) => { | |
item.addEventListener("mousemove", () => { | |
addSelected2(ulRes, item); | |
}, false); | |
// if <a> focused by a Tab key | |
item | |
.getElementsByClassName("item__content")[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// anchor link fixed navigation from top | |
function offsetAnchor() { | |
if (location.hash.length !== 0) { | |
window.scrollTo(window.scrollX, window.scrollY - 60); | |
} | |
} | |
// Captures click events of all <a> elements with href starting with # | |
addEventListener('click', function (e) { | |
// Click events are captured before hashchanges. Timeout | |
// causes offsetAnchor to be called after the page jump. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cd-top { | |
display: inline-block; | |
height: 50px; | |
width: 50px; | |
position: fixed; | |
bottom: 2%; | |
right: 2%; | |
border-radius: 40px; | |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); | |
/* image replacement properties */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hs__title">Click here</div> | |
<div class="hs__content">Content</div> |
NewerOlder