Skip to content

Instantly share code, notes, and snippets.

View nhanph94's full-sized avatar

Nhân Phan nhanph94

View GitHub Profile
name: ecstatic_allen
services:
main_app:
cpu_shares: 50
command: []
container_name: nginx-proxy
deploy:
resources:
limits:
@nhanph94
nhanph94 / udemy_dl.py
Created October 12, 2022 19:10 — forked from kahirul/udemy_dl.py
UdemyDL. Udemy downloader. Customize for UFB (Udemy For Bussiness). Fix csrf token handling
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Main script for udemy-dl."""
from __future__ import unicode_literals
from __future__ import print_function
from builtins import str
from builtins import input
import json
import re
@nhanph94
nhanph94 / fb-video-downloader-script.js
Created July 8, 2022 04:27 — forked from monokaijs/fb-video-downloader-script.js
A small snippet to help you download Facebook video at ease...
/**
** Author: @MonokaiJs
** Contact: monokaijs@northstudio.vn | https://fb.me/monokaijssss | monokaijs.com
**
** Free to use, but don't abuse :>
**/
(()=>{let a=location.href.match(/\/(?:videos|reel|watch)(?:\/?)(?:\?v=)?(\d+)/);if(a.length<2){console.log("Please open a video before running this script.");return}let c=function(d,e){let f=[],a;for(a in d)if(d.hasOwnProperty(a)){let g=e?e+"["+a+"]":a,b=d[a];f.push(null!==b&&"object"==typeof b?c(b,g):encodeURIComponent(g)+"="+encodeURIComponent(b))}return f.join("&")},b=function(a,b){return fetch("https://www.facebook.com/api/graphql/",{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:c({doc_id:a,variables:JSON.stringify(b),fb_dtsg:require("DTSGInitialData").token,server_timestamps:!0})})};console.log("Getting info..."),b("5279476072161634",{UFI2CommentsProvider_commentsKey:"CometTahoeSidePaneQuery",caller:"CHANNEL_VIEW_FROM_PAGE_TIMELINE",displayCommentsContextEnableComment:null,displayCommentsContextIsAdPreview:null,displayComm
@nhanph94
nhanph94 / nodemon.json
Created February 7, 2022 10:08
Typescript nodemon ultimate setup
{
"restartable": "rs",
"ignore": [".git", "node_modules/", "dist/", "coverage/"],
"watch": ["src/"],
"execMap": {
"ts": "node -r ts-node/register"
},
"env": {
"NODE_ENV": "development"
},
@nhanph94
nhanph94 / SassMeister-input.scss
Created June 24, 2021 14:33 — forked from lewismcarey/SassMeister-input.scss
Get Color from SASS Color Map
// ----
// libsass (v3.2.5)
// ----
// Color Map
$colors: (
blue: #0000FF,
red: (
base: #FF0000,
light: #EEEEFF,
@nhanph94
nhanph94 / HttpStatusCode.ts
Created April 26, 2021 01:42 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@nhanph94
nhanph94 / Retrieving Access Token From OneDrive using Google Apps Script.md
Last active April 14, 2020 04:39 — forked from tanaikech/submit.md
Retrieving Access Token From OneDrive using Google Apps Script

Retrieving Access Token From OneDrive using Google Apps Script

Overview

This GAS sample is for retrieving access token to use OneDrive APIs using Google Apps Script.

In this script, the authorization code is automatically retrieved.

Demo

@nhanph94
nhanph94 / Upload contents for an item on OneDrive.md
Last active April 14, 2020 04:40 — forked from tanaikech/submit.md
Uploading Files to OneDrive Using Node.js

In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.

1. Simple item upload

This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.

var fs = require('fs');
var mime = require('mime');
var request = require('request');
@nhanph94
nhanph94 / resumableUpload.js
Created April 12, 2020 19:22 — forked from dam1/resumableUpload.js
Resumable Upload Google Drive Api - Node Js
var fs = require('fs');
var request = require('request');
var EventEmitter = require('events').EventEmitter;
var mime = require('mime');
var util = require('util');
function resumableUpload() {
this.byteCount = 0; //init variables
this.tokens = {};
this.filepath = '';