Skip to content

Instantly share code, notes, and snippets.

@quantrung9
quantrung9 / README.md
Created January 28, 2025 18:38 — forked from fwalzel/README.md
Running a Vue.js App as a Stand-alone Executable (Mac / Windows)

Running a Vue.js App as a Stand-alone Executable (Mac / Windows)

This gist describes how to bundle a built Vue.js project – the dist folder – together with a local web server in a stand-alone executable (no Node.js installation needed on the client).

Problem

When we want to present a completed Vue project to a third party (a client, a collaborator, etc.), we cannot just send the dist folder and explain how to open the index.html file. This won’t work because Vue presupposes a web server to run (at least as long as we don't manipulate the publicPath configuration). Setting up a whole web hosting environment, organizing a domain name, and securing it with a server lock, among other things, can be a bit much. On the other hand, explaining someone with no technical background how to install Node.js and run a local web server just to see our project is equally inconvenient. This can be a problem.

Solution

@quantrung9
quantrung9 / README.md
Last active December 18, 2022 17:46
Generate outfits from twelve70.com main closet then add to favourite

Scripts to automate twelve70.com

How to run the script: You should copy and paste it into the browser console.

Generate outfits from main closet then add to favourite

You should close the site when there are no outfits generated anymore.

image

@quantrung9
quantrung9 / InstallOpenVPNGuide.md
Last active August 9, 2018 00:52
Setup OpenVPN on VPS
d=3; % Change this to change the size of the matrix
n=10; % Change this to change the range of the numbers
floor(n*rand(d,d))
@quantrung9
quantrung9 / callback.js
Created March 15, 2016 04:05
How to use callback
function getArticleUrlPerPage(pageNumber, articleUrls, callback) {
var options = {
method: 'GET',
url: 'https://www.getnewsmart.com/?last_time_title=This+week&page=' + pageNumber + '&section=&xhr=true',
};
request(options, function(error, response, body) {
if (error) throw new Error(error);
$ = cheerio.load(body);
$('.text-wrapper').each(function(i, elem) {
@quantrung9
quantrung9 / promise.js
Last active March 15, 2016 04:01
How to use promise
var Q = require('q');
var request = require('request');
var cheerio = require('cheerio');
function getArticleUrlPerPage(pageNumber, articleUrls) {
var deferred = Q.defer();
var options = {
method: 'GET',
@quantrung9
quantrung9 / callback.js
Created March 12, 2016 18:55
callback example
// global variable
var allUserData = [];
function logStuff (userData) {
console.log('22222222');
if ( typeof userData === "string")
{
console.log(userData);
}
else if ( typeof userData === "object")
@quantrung9
quantrung9 / casper.js
Last active March 15, 2016 19:05
How to crawl with casperjs (bypass login page)
var casper = require('casper').create();
var url = 'https://www.getnewsmart.com/articles/80250-xiaomi-keeps-sights-on-india-has-no-ipo-timetable';
casper.start(url, function() {
this.echo(this.getTitle());
})
casper.waitFor(function check() {
return true;
@quantrung9
quantrung9 / gist:59ed8e1b4bef117ff886
Last active February 10, 2016 15:47
Requirement to use PHPExcel
use this script to check:
<?php
echo "GD: ", extension_loaded('gd') ? 'OK' : 'MISSING', '<br>';
echo "XML: ", extension_loaded('xml') ? 'OK' : 'MISSING', '<br>';
echo "zip: ", extension_loaded('zip') ? 'OK' : 'MISSING', '<br>';
?>
by default XML and ZIP is OK, GD have to install manually: `sudo apt-get install php5-gd`
@quantrung9
quantrung9 / gist:1f072bdad055732cbf21
Last active February 10, 2016 15:47
Config /etc/php5/apache2/php.ini to enable xdebug
--Add lines to php.ini
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000