Skip to content

Instantly share code, notes, and snippets.

View ngxson's full-sized avatar

Xuan Son Nguyen ngxson

View GitHub Profile
@ngxson
ngxson / appscript.js
Last active November 13, 2017 08:27
chatbot beta webhook
var HOOK_FB_ID = "267312947032250";
var TARGET_FB_ID = "182794865548469";
var TARGET_FB_TOKEN = "token có quyền publish bài";
function doGet(e) {
if (e.parameter['hub.verify_token'] === 'o3OfDSJc7qrRkiDbCoLJeHKGHQl81a') {
var textContent = ContentService.createTextOutput(e.parameter['hub.challenge']);
textContent.setMimeType(ContentService.MimeType.TEXT);
return textContent;
}
@ngxson
ngxson / 2018.html
Created December 29, 2017 06:05 — forked from anonymous/2018.html
lich2018
<html>
<head>
<title></title>
</head>
<body>
<link href="https://fonts.googleapis.com/css?family=Cabin" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Courgette" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Noto+Serif" rel="stylesheet">
@ngxson
ngxson / example.c
Created January 12, 2018 13:20
Hearty.vn - Example
#include <stdio.h>
int main() {
int array[10],i;
for (i = 0 ; i <= 10 ; i++) {
array[i] = 0;
printf("Hearty.vn\n");
}
return 0;
}
@ngxson
ngxson / fetchKeyOnly.js
Last active December 2, 2018 16:34
Firebase Tips
var { google } = require("googleapis");
var request = require("request");
var serviceAccountDir = "./serviceAccountKey.json"
generateAccessToken(serviceAccountDir).then(access_token => {
request({
url: "https://database-cua-ban.firebaseio.com/path/nao/do.json",
qs: {
shallow: "true",
@ngxson
ngxson / index.js
Created August 3, 2019 21:07
tonghopevent-autorep2
const fs = require('fs')
let content = fs.readFileSync('./input.txt').toString()
content = content.replace(/\$\$\$\$\$\$\$\$\$\$/g, '▓')
content = content.split('▓')
function toWordArray(c) {
let words = c.replace(/\n/g, ' ').split(' ')
words = words.map(w => {
return w.toLowerCase()
@ngxson
ngxson / source.c
Created November 15, 2019 13:10
TD2
#include <stdio.h>
int main() {
#ifdef _POSIX_SOURCE
printf("_POSIX_SOURCE=%d\n", _POSIX_SOURCE);
#endif
#ifdef _SVID_SOURCE
printf("_SVID_SOURCE=%d\n", _SVID_SOURCE);
#endif
@ngxson
ngxson / command.bat
Last active February 29, 2020 11:05
protectvideodownload dot com
ffmpeg -protocol_whitelist file,https,http,crypto,data,tls -i ./video.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
@ngxson
ngxson / music-transpose.ipynb
Last active May 11, 2020 11:54
Music Transpose.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ngxson
ngxson / default.conf
Last active February 15, 2023 19:03
Portainer docker + JS injection
js_path "/etc/nginx/conf.d/";
js_import main from default.js;
server {
listen 9443 default_server ssl http2;
listen [::]:9443 default_server ssl http2;
ssl_certificate /certs/cert.pem;
ssl_certificate_key /certs/key.pem;
set $target "http://172.17.0.1:9000";