Skip to content

Instantly share code, notes, and snippets.

View DanielChuDC's full-sized avatar
🎯
Focusing

danielchu DanielChuDC

🎯
Focusing
  • singapore
View GitHub Profile
@DanielChuDC
DanielChuDC / auth.service.ts
Created July 24, 2020 12:34 — forked from codediodeio/auth.service.ts
Angular4 Firebase authentication service using OAuth, Anonymous, and Email/Password. Designed specifically for changes introduced in AngularFire2 4.0.0
import { Injectable } from '@angular/core';
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Router } from "@angular/router";
import * as firebase from 'firebase';
@Injectable()
export class AuthService {
@DanielChuDC
DanielChuDC / basic.md
Created July 24, 2020 01:48 — forked from zenorocha/basic.md
New Firebase Auth vs Old Firebase Auth
@DanielChuDC
DanielChuDC / app.e2e-spec.ts
Created July 21, 2020 01:16
Angular 10 Protractor function
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
@DanielChuDC
DanielChuDC / lvm.sh
Created May 10, 2020 01:38 — forked from jchodakowski/lvm.sh
Complex filesystem shell script
#!/bin/sh
case "$1" in
# update the file 'partman-base.postinst' with our filesystem "installer"
installer)
#sed -i 's/partman/\/tmp\/lvm.sh partman/' /var/lib/dpkg/info/partman-base.postinst
sed -i 's/partman/\/tmp\/lvm.sh destroy; \/tmp\/lvm.sh partman/' /var/lib/dpkg/info/partman-base.postinst
logger -t lvm.sh modified partman-base.postinst
;;
@DanielChuDC
DanielChuDC / .bash_aliases
Created May 4, 2020 14:58 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@DanielChuDC
DanielChuDC / VMwareFusion_Export_ovf.txt
Created March 28, 2020 03:48 — forked from xl7dev/VMwareFusion_Export_ovf.txt
HowTo Export a VM in OVA format in VMware Fusion for OS X
> cd /Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool
> ./ovftool --acceptAllEulas /Users/marco/Documents/Virtual\ Machines.localized/Windows\ 8.1\ x64.vmwarevm/Windows\ 8.1\ x64.vmx /Users/marco/Desktop/Win81.ova
@DanielChuDC
DanielChuDC / vagrant virtualbox vm to vmwarefusion.md
Created March 27, 2020 07:54 — forked from biophonc/vagrant virtualbox vm to vmwarefusion.md
Migrate Vagrant VirtualBox VM to VMware Fusion

Migrate Vagrant VirtualBox VM to VMware Fusion

Notes:

  • Unfortunately the process is not as simple as I'd have expected it, that's why I wrote this little step-by-step instruction.
  • My setup is/was:
    • OSX 10.9.4
    • VirtualBox 4.3.12
    • VMware Fusion 6.0.4
    • OS as VM to migrate: Ubuntu 10.04.4 LTS
@DanielChuDC
DanielChuDC / update-golang.md
Created March 20, 2020 02:40 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@DanielChuDC
DanielChuDC / reregister-qemu-binfmt.sh
Created March 13, 2020 11:18 — forked from ArturKlauser/reregister-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) [email protected]
#
# This script tries to reregister QEMU's binfmt_misc handlers with the
# fix-binary (F) flag in order to be usable with 'docker buildx' to build
# multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
function remove_binfmt() {
@DanielChuDC
DanielChuDC / check-qemu-binfmt.sh
Created March 13, 2020 11:16 — forked from ArturKlauser/check-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) [email protected]
#
# This script checks if all software requirements are met in a Linux environment
# in order to use 'docker buildx' to build multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
function error() {
echo "ERROR: $*"