Skip to content

Instantly share code, notes, and snippets.

View ethanliew's full-sized avatar

Ethanz Liew ethanliew

View GitHub Profile
@ethanliew
ethanliew / aspnet-core-2-ubuntu-setup.md
Created July 22, 2018 09:47 — forked from odan/aspnet-core-2-ubuntu-setup.md
Installing ASP.NET Core 2.1 on Ubuntu 18.4 Linux
@ethanliew
ethanliew / curl.md
Created September 7, 2018 03:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

FFmpeg has been removed from Ubuntu 14.04 and was replaced by Libav. This decision has been reversed so that FFmpeg is available now in Ubuntu 15.04 again, but there is still no official package for 14.04. In this tutorial, I will show you how to install FFmpeg from mc3man ppa. Add the mc3man ppa:
sudo add-apt-repository ppa:mc3man/trusty-media
And confirm the following message by pressing <enter>:
Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades
More info: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media
Press [ENTER] to continue or ctrl-c to cancel adding it
Update the package list.
@ethanliew
ethanliew / git-deployment.md
Created September 16, 2018 00:51 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@ethanliew
ethanliew / Git push deployment in 7 easy steps.md
Created September 16, 2018 01:00 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@ethanliew
ethanliew / ultimate-ut-cheat-sheet.md
Created October 6, 2018 09:02 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@ethanliew
ethanliew / aes_encryption_helper.dart
Created December 26, 2018 05:50 — forked from proteye/aes_encryption_helper.dart
How to AES-256 (CBC/CFB mode) encrypt and decrypt in Dart/Flutter with Pointy Castle
import 'dart:convert';
import 'dart:typed_data';
import "package:pointycastle/export.dart";
import "./convert_helper.dart";
// AES key size
const KEY_SIZE = 32; // 32 byte key for AES-256
const ITERATION_COUNT = 1000;
@ethanliew
ethanliew / SimpleEncryptionPlugin.kt
Created December 26, 2018 10:38 — forked from sroddy/SimpleEncryptionPlugin.kt
Flutter Simple Cryptor
package com.bendingspoons.simpleencryption
import com.tozny.crypto.android.AesCbcWithIntegrity.*
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.PluginRegistry.Registrar
class SimpleEncryptionPlugin() : MethodCallHandler {
@ethanliew
ethanliew / intl_locale_override.dart
Created December 28, 2018 08:56 — forked from ilikerobots/intl_locale_override.dart
Example of overriding default locale for use with intl
import 'dart:async';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl_translate_example/l10n/messages_all.dart';
void main() => runApp(new MyApp());
class Translations {
static Future<Translations> load(Locale locale) {
@ethanliew
ethanliew / avd.sh
Created January 16, 2019 09:11 — forked from hidroh/avd.sh
Handy bash script to prompt for an Android virtual device (AVD) selection and launch it. Assuming that Android SDK has been set up and is in user PATH.
emulator -list-avds | cat -n
printf "Select AVD: "
read index
avd=$(emulator -list-avds | sed "${index}q;d")
echo "Selected $avd"
emulator -netdelay none -netspeed full -avd $avd