Skip to content

Instantly share code, notes, and snippets.

View lahirwisada's full-sized avatar

Lahir Wisada Santoso lahirwisada

View GitHub Profile
@lahirwisada
lahirwisada / encrypter.js
Created July 27, 2022 17:01 — forked from Agoreddah/encrypter.js
Laravel encrypt & decrypt in Node.js
// load variables
require('dotenv').config();
// load dependencies
const crypto = require('crypto');
'use strict';
const APP_KEY = process.env.APP_KEY;
@lahirwisada
lahirwisada / extract_zip_subdir.php
Created September 5, 2017 06:56 — forked from liconti/extract_zip_subdir.php
PHP extract a subdirectory contained in a ZIP file to a destination path
<?php
function extract_zip_subdir($zipfile, $subpath, $destination, $temp_cache, $traverse_first_subdir=true){
$zip = new ZipArchive;
echo "extracting $zipfile... ";
if(substr($temp_cache, -1) !== DIRECTORY_SEPARATOR) {
$temp_cache .= DIRECTORY_SEPARATOR;
}
$res = $zip->open($zipfile);
if ($res === TRUE) {
if ($traverse_first_subdir==true){
@lahirwisada
lahirwisada / XML2003Parser.php
Created February 6, 2017 12:25 — forked from faisalman/XML2003Parser.php
PHP class for parsing Microsoft Excel 2003 XML Spreadsheet
<?php
/**
* Excel 2003 XML-Parser
*
* PHP library for parsing Microsoft Excel 2003 XML Spreadsheet
* http://gist.github.com/862741
*
* Copyright (c) 2011 Faisalman <movedpixel@gmail.com>
*