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
@parties
parties / renameReactJsToJsx.sh
Last active July 19, 2024 19:27
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;
@jbanety
jbanety / build_pcntl.sh
Last active February 6, 2024 02:50
(Updated) Build PCNTL ext for MAMP PHP 7.4.2
#!/bin/bash
PHP_VERSION=7.4.2
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl lzlib curl imap-uw readline postgresql gettext libxslt libiconv bison pkg-config krb5 bzip2 openldap tidy-html5
# Dirs
<#
.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 (
@Wicowyn
Wicowyn / addImage.java
Created October 8, 2015 15:41
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();
@thomasfr
thomasfr / warmly.sh
Last active October 12, 2023 06:17
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)
#