Skip to content

Instantly share code, notes, and snippets.

View duongphuhiep's full-sized avatar

DUONG Phu-Hiep duongphuhiep

  • lemonway.fr
  • Paris, France
View GitHub Profile
@duongphuhiep
duongphuhiep / rename_column.sql
Created August 1, 2016 09:59
t-sql rename column
if not exists (select 1 from sys.columns where name = 'ChargeBackData' and OBJECT_NAME(object_id)='AlreadyTreated')
exec sp_rename 'ChargeBackData.AlreadyTreated', 'Refunded', 'COLUMN';
GO
@duongphuhiep
duongphuhiep / model.md
Last active December 26, 2016 16:17
Security model

#For EBICS Feature (Subject) = ImportTab, MoneyInTab, MoneyOutTab, ChargebackTab.. Right (Action) = View (Read), Write, Add, Delete, Exec, Eval... Privilege = Right + Feature Permission = Login + Privilege

#For Directkit: Subject = Any, WalletSC, WalletLW, WalletMerchant, WalletTechnique, IpWhitelist.. Action = Any, View, Add, MoneyIn, MoneyOut, Delete, RegisterCard, RegisterIBAN... Role = SuperUser, lwAdmin, mbAdmin, mbManager, mbOperator...

@duongphuhiep
duongphuhiep / redirect.php
Last active September 20, 2016 09:13
Redirect with POST data in PHP
/*
* Redirect using javascript. work only with empty DOM, nothing should be written to the DOM when calling this function
*/
static function redirectWithPostParams($url, $params){
echo "
<html><body onload='document.frm.submit()'>
<form action='$url' method='post' name='frm'>";
foreach ($params as $key => $value) {
echo "<input type='hidden' name='".htmlentities($key)."' value='".htmlentities($value)."'>";
@duongphuhiep
duongphuhiep / printCardForm.php
Created January 3, 2017 14:57
Print the atos form with token
function printCardForm($moneyInToken, $cssUrl = '', $language = 'fr')
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, WEBKIT_SITE . "?moneyintoken=" . $moneyInToken . '&p=' . urlencode($cssUrl) . '&lang=' . $language);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //true
$server_output = curl_exec($ch);
if (curl_errno($ch)) {
die('curl_err : ' . curl_error($ch));
@duongphuhiep
duongphuhiep / .gitconfig
Last active August 11, 2025 13:08
fix git command
[user]
name = DUONG Phu-Hiep
email = [email protected]
[core]
autocrlf = true
editor = code
precomposeunicode = true
ignorecase = false
excludesfile =
[alias]
@duongphuhiep
duongphuhiep / shipyard.sh
Last active January 15, 2017 00:51
helper shell script for Shipyard for start/stop/deploy/upgrade/remove docker Shipyard
#!/bin/sh
# DIRNAME=`which dirname`
# SCRIPT_LOCATION=$0
# SCRIPT_DIR=`dirname "$SCRIPT_LOCATION"`
usage() {
cat <<EOM
Helper to manage the Shipyard docker
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2021-03-07 11:26:51" build="210304">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::cmd}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@duongphuhiep
duongphuhiep / test.cs
Last active February 14, 2017 16:57
Error double/float numerical in all the language, in c# you have to use decimal for every currency-related thing
[TestMethod]
public void testDatFail()
{
var roll = 4.34 - 0.23; //4.11
Assert.IsTrue(4.11 <= roll); //BAM!!
}
[TestMethod]
public void testDatOK()
{
@duongphuhiep
duongphuhiep / app.ini
Last active February 20, 2017 12:02
Gogs Issue: Windows SSH: Error on handshaking. Auth fail: https://github.com/gogits/gogs/issues/4160
APP_NAME = My Company's Git Server
RUN_USER = git
RUN_MODE = prod
[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gogs
USER = root
PASSWD =
@duongphuhiep
duongphuhiep / input.conf
Last active March 2, 2018 07:14
Video Player Key bindings mpv.io to put in ~/.config/mpv/input.conf
# Default keybindings: https://raw.githubusercontent.com/mpv-player/mpv/master/etc/input.conf
PGDWN playlist-next
PGUP playlist-prev
n playlist-next
p playlist-prev
ENTER cycle fullscreen
RIGHT seek 3
LEFT seek -3
CTRL+RIGHT seek 10