Skip to content

Instantly share code, notes, and snippets.

View lockevn's full-sized avatar
🌴
On fire but coding

Thach Lockevn lockevn

🌴
On fire but coding
View GitHub Profile
@lockevn
lockevn / 2_keyboard_shortcuts.md
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.

Create documentation for your projects. Like so:


Most popular keyboard shortcuts within GistBox

  • Up/Down - Previous/Next Gist
  • Ctrl+e - Edit a selected Gist
  • Ctrl+s - Save Gist
<test>
<entry>
<id>1</id>
<value>test</value>
</entry>
</test>
@lockevn
lockevn / gurucore.net.ts
Created June 19, 2018 10:53
Download image (and binary file) to a file on disk, using axios
const axios = require('axios')
/**
* Download url to a file on disk
* @param url
* @param destFile
*/
async function downloadAxios(url: string, destFile: string) {
const response = await axios({
method: 'GET',
@lockevn
lockevn / head.js
Created July 26, 2020 12:14
Inject an inline JavaScript in to head of page rendered by Nuxt
/**
* All of these can be overrided in each page component via define method https://nuxtjs.org/api/pages-head/
* E.g.: head() { return { title: "", meta: [] } }
*/
export default {
titleTemplate: "%s - " + _WhiteLabel.brandname,
title: "Shop",
meta: [
{ "http-equiv": "utf-8" },
{ charset: "X-UA-Compatible", content: "IE=edge" },
@lockevn
lockevn / gist:f0e2a3692ab031ef2ef6e47310c04750
Last active May 8, 2021 09:07
Fix: ASUS USB2.0 hd UVC webcam not working
Software
========
Follow these
https://www.asus.com/me-en/support/FAQ/109836/
https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/webcam-not-working-usb20-hd-uvc-webcam/547e3a25-1c2c-44b1-80a1-d2be52afeb5c
https://www.drivereasy.com/knowledge/fixed-asus-usb2-0-webcam-issue-in-windows-10/
Hardware
@lockevn
lockevn / telegram.message.webhook.sample.js
Last active August 2, 2022 07:28
Sample message send from Telegram to bot webhook
/**
message format,
update_id is the data-mid when we inspect the web.telegram.org message
message.message_id is the number when we use mouse to copy link to specific message
*/
// bot can receive this
const sampleAdminPostToChannel = {
update_id: 72955,
channel_post: {