Skip to content

Instantly share code, notes, and snippets.

View vunguyen-it's full-sized avatar

Vu Nguyen vunguyen-it

  • Manifera Software Development Pte Ltd
  • Việt Nam
View GitHub Profile
@vunguyen-it
vunguyen-it / convert_ascii.php
Created March 22, 2016 03:57 — forked from jaywilliams/convert_ascii.php
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@vunguyen-it
vunguyen-it / addImage.java
Created April 11, 2017 08:39 — forked from Wicowyn/addImage.java
Add image to PDF with PDFBox-Android
try {
final File realDocument = new File(adapter.get(currentPage).getUriLocal().getPath());
final File copyDocument = File.createTempFile("pdf", "pdf");
IOUtils.copy(new FileInputStream(realDocument), new FileOutputStream(copyDocument));
PDDocument document = PDDocument.load(copyDocument);
PDPage page=document.getPage(document.getNumberOfPages() - 1);
ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
<#
.SYNOPSIS
Performs a SQL query and returns an array of PSObjects.
.NOTES
Author: Jourdan Templeton - hello@jourdant.me
.LINK
https://blog.jourdant.me/post/simple-sql-in-powershell
#>
function Invoke-SqlCommand() {
[cmdletbinding(DefaultParameterSetName="integrated")]Param (
@vunguyen-it
vunguyen-it / build_pcntl.sh
Last active April 19, 2018 03:24 — forked from jbanety/build_pcntl.sh
Build PCNTL ext for MAMP PHP 7.1.1
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.1.1/include
cd /Applications/MAMP/bin/php/php7.1.1/include

Keybase proof

I hereby claim:

  • I am vunguyen-it on github.
  • I am vunguyen10989 (https://keybase.io/vunguyen10989) on keybase.
  • I have a public key ASBhlj2MUYjvoZsFqhidByqGRhy3dZ7nsfGoliN86sFcpgo

To claim this, I am signing this object:

@vunguyen-it
vunguyen-it / gist:8758a7acf95240a2b3b0215b6b5b9cad
Created December 8, 2022 03:18
Dockerfile for auto devops with awscli, kubectl, helm
# aws-devops docker image for bitbucket pipeline
FROM alpine:3.17.0
RUN apk add --no-cache helm curl aws-cli
RUN curl -LO https://dl.k8s.io/release/v1.25.0/bin/linux/amd64/kubectl && \
mv ./kubectl /usr/local/bin/
RUN chmod +x /usr/local/bin/kubectl
@vunguyen-it
vunguyen-it / warmly.sh
Created October 12, 2023 06:17 — forked from thomasfr/warmly.sh
A wget based easy poor man`s cache warmer script
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#