Skip to content

Instantly share code, notes, and snippets.

View mig1098's full-sized avatar

miglio esaud mig1098

View GitHub Profile
<?php
function buildtree(&$result,$dropdown,$space=' ',$bool=true){
if(!is_array($dropdown) || count($dropdown) < 1 ){ return false; }
$i = 0;
$space .= $bool ? $space : '';
while($i < count($dropdown)){
$key = key($dropdown);
$result .= $space;
$result .= ( is_numeric($key) ? $dropdown[$key] : $key );
$result .= '<br />';
@mig1098
mig1098 / array_tree_v2.php
Created September 14, 2016 16:59
using bootstrap css
<?php
function buildtree(&$result,$dropdown,$space='',$callback=null){
$drop = false;
if(!is_array($dropdown) || count($dropdown) < 1 ){ return false; }
$i = 0;
$space .= $space;
while($i < count($dropdown)){
$key = key($dropdown);
$item = ( is_numeric($key) ? $dropdown[$key] : $key );
$childexist = !empty($dropdown[$item]) && is_array($dropdown[$item]);
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@mig1098
mig1098 / originate_call.php
Created November 9, 2017 16:54 — forked from anpel/originate_call.php
Originate a call from Asterisk using PHP and Asterisk Manager Interface
/**
* Once this scipt is executed it will connect to the local port you have assigned to
* Asterisk (default: 5038) and send an authentication request. If successfull, it will
* send a second request to originate your call.
*
* The internal SIP line $internalPhoneline will be dialed, and when picked up the
* $target phone will be dialed using your outbound calls context ($context).
*
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs.
* you can find more about the available options at:
@mig1098
mig1098 / kmskeys10.txt
Created February 20, 2018 14:16 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
@mig1098
mig1098 / PHP-Interactive-CLI-Install-from-Source.md
Created March 20, 2018 04:33 — forked from christopher-hopper/PHP-Interactive-CLI-Install-from-Source.md
Install PHP from a source download to enable its interactive command-line shell interface on Linux.

PHP Interactive CLI Install

The following commands can be used to install PHP from source with an interactive command-line shell interface on Linux.

This interactive shell, (command: php -a) was the main reason I built from source to begin with. Now though I am able to play with the latest PHP versions as soon as they are available.

The commands below were written for and tested on the following system.

  • OS: Ubuntu 14.04.4 LTS (trusty)
@mig1098
mig1098 / curl.md
Created July 31, 2018 14:16 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mig1098
mig1098 / javascript_unicode.html
Last active February 23, 2025 18:49
javascript unicode accents
Question: Can I display accented characters or ligatures as part of JavaScript output?
Answer: You can include accented characters and ligatures in JavaScript strings and/or display them on your HTML pages using the following encodings for the letters:
hexadecimal codes \xXX in JavaScript strings; e.g. ñ is \xF1
Unicode hex codes \uXXXX in JavaScript strings; e.g. š is \u0161
HTML entities; for example, ñ is &ntilde; and š is &scaron;
numeric HTML entities; e.g. ñ is &#241; and š is &#353;
unescape with a suitable argument; e.g. ñ is unescape('%F1')
decodeURI with a suitable argument; e.g. ñ is decodeURI('%C3%B1')
@mig1098
mig1098 / download_wav.php
Created October 24, 2018 20:13
headers for download wav audio
$ctype ='audio/x-wav';
$filepath = '/var/www/html/audio.wav';
$size = filesize($filepath);
$name = basename($filepath);
$fp=fopen($fichero, "rb");
if ($size && $ctype && $fp) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
@mig1098
mig1098 / .htaccess
Created January 30, 2019 13:54
codeigniter htaccess
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>