Skip to content

Instantly share code, notes, and snippets.

View wutipong's full-sized avatar

Wutipong Wongsakuldej wutipong

View GitHub Profile

Most application, services, app, program, whatever has some kind of configurations. Some of the them are visible to the user, some of them are only available to the provider, some of them might be derived from other settings.

In larger applications, like web services and stuffs, configurations play a huge role. No one wants to recompile the whole program when there are needs to move the log file location, for example. Well-implemented applications provides numbers of configuration, so they are flexible enough to handle different environments and usages.

Below is what I think it should be taken in consideration when designing configuration management.

Configuration implementation is 'details'.

There are multiple way to keep and to read the configuration. It could be an in-memory objects, SQLite, SQL server, No-SQL server, Redis, or even a configuration server. Regardless, this should be considered as a 'detail'. The application should not aware of how these operations work. It should be able to query t

import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
// JS import
import Vue from 'vue';
import App from './App.vue'
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue);
@wutipong
wutipong / ch01.md
Last active May 1, 2018 12:24
C++ Training

C++ Training #1 - Basic Construct

Hello World

#include <iostream>
using std::cout;
using std::endl


int main(int argc, char** args) {

C++ for Java Programmer.

notice

Some construct that is almost identical between Java and C++ (eg. loop statement, condition statement) may not be discussed in this document.

Hello World

#include <iostream>

int main(int argc, char** args) {
@wutipong
wutipong / SkiaForm.cs
Last active February 14, 2018 12:08
skiasharp test
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SkiaSharp;
#include <iostream>
#include <codecvt>
#include <iomanip>
#include <SDL2/SDL.h>
#include <ft2build.h>
#include FT_FREETYPE_H
constexpr char teststring[] {"Hello World"};
/**************************************************************************
* AlStream : Play streaming OGG file with custom loop points.
* License : Public Domain.
* Usage: alStream input.ogg
*
* Note:
*
* The input file will be played infintely until the program close. If the
* input file has the `loop_end` comment in its header, the file will be played
* to that point then loop back to start. If the input file has the `loop_start`
@wutipong
wutipong / sdl_mixer_stream_ogg_with_loop.cpp
Created January 11, 2016 22:04
Plays OGG in infinite loop with SDL_mixer
#include <iostream>
#include <SDL.h>
#include <SDL_mixer.h>
#include <vorbis/vorbisfile.h>
using namespace std;
int main(int, char **) {
SDL_Init(SDL_INIT_EVERYTHING);
atexit(SDL_Quit);
Mix_Init(MIX_INIT_FLAC | MIX_INIT_OGG);
@wutipong
wutipong / sdl_render-text-with-direction.cpp
Last active January 16, 2023 03:18
SDL Render text with Freetype and harfbuzz, using outline render.
#include <iostream>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_main.h>
#include <string>
@wutipong
wutipong / timer.cpp
Last active September 3, 2015 16:25
Simple time measurement class. Useful for finding how long a function/a scope runs.
#include <iostream>
#include <array>
#include <chrono>
#include <string>
#include <ctime>
#include <cstdlib>
class timer {
private:
const std::chrono::system_clock::time_point start;