Skip to content

Instantly share code, notes, and snippets.

View ddanh85's full-sized avatar
🏠
Working from home

Dai Phong ddanh85

🏠
Working from home
View GitHub Profile
@ddanh85
ddanh85 / creative-cloud-disable.md
Created November 11, 2023 05:06 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@ddanh85
ddanh85 / Activate Office 2019 for macOS VoL.md
Created August 2, 2023 08:42 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@ddanh85
ddanh85 / server.js
Created December 19, 2018 14:14
redirect http-https in google cloud app engine with express js
//HTTPS redirect middleware
function ensureSecure(req, res, next) {
//GC stores the origin protocol in a header variable. The app itself is isolated within the dyno and all request objects have an HTTP protocol.
if (req.get('X-Forwarded-Proto')=='https' || req.hostname == 'localhost') {
//Serve App by passing control to the next middleware
next();
} else if(req.get('X-Forwarded-Proto')!='https' && req.get('X-Forwarded-Port')!='443'){
//Redirect if not HTTP with original request URL
res.redirect('https://' + req.hostname + req.url);
}
@ddanh85
ddanh85 / app.yaml
Created December 18, 2018 05:25 — forked from darktable/app.yaml
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@ddanh85
ddanh85 / gulpfile.js
Created December 14, 2018 07:08
My bootstrap theme workflow with gulp js
const gulp = require('gulp');
const nunjucksRender = require('gulp-nunjucks-render');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const changed = require('gulp-changed');
const sourcemaps = require('gulp-sourcemaps');
const concat = require('gulp-concat');
const autoprefixer = require('gulp-autoprefixer');
@ddanh85
ddanh85 / slugify.js
Created December 14, 2018 06:43 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@ddanh85
ddanh85 / gulpfile.js
Created October 24, 2018 06:43 — forked from aljopro/gulpfile.js
Static Site Generator using Gulp, Nunjucks, and Markdown with Front Matter
const gulp = require('gulp');
const nunjucksRender = require('gulp-nunjucks-render');
const gulpGrayMatter = require('gulp-gray-matter');
const debug = require('gulp-debug');
const markdown = require('gulp-markdown');
const data = require('gulp-data');
const through = require('through2');
const fs = require('fs');
const path = require('path');
@ddanh85
ddanh85 / gulpfile.js
Created October 18, 2018 14:10 — forked from yomotsu/gulpfile.js
rollup /w gulp
'use strict';
const browserSync = require( 'browser-sync' ).create();
const gulp = require( 'gulp' );
const gulpif = require( 'gulp-if' );
const rename = require( 'gulp-rename' );
const uglify = require( 'gulp-uglify' );
const rollup = require( 'rollup' );
const rollupStream = require( 'rollup-stream' );
@ddanh85
ddanh85 / build.js
Created October 18, 2018 14:08 — forked from AndrewHenderson/build.js
Rollup, Gulp, and Babel (ES6)
// Gulp
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import file from 'gulp-file';
import filter from 'gulp-filter';
import rename from 'gulp-rename';
import sourcemaps from 'gulp-sourcemaps';
import uglify from 'gulp-uglify';
// Rollup
import { rollup } from 'rollup';