Skip to content

Instantly share code, notes, and snippets.

View nelson6e65's full-sized avatar
:atom:
Creating software

Nelson Martell nelson6e65

:atom:
Creating software
View GitHub Profile
@Ismael-VC
Ismael-VC / xml_to_html.py
Last active August 29, 2015 14:21
XML to HTML
from pandas import DataFrame
from requests import post
from xmltodict import parse
def get_data(api_url, dataname, key, token, table, column, value):
'''Convierte la tabla en XML que regresa la respuesta a HTML.'''
response = post(
api_url,
data = {
@nelson6e65
nelson6e65 / config_hooks.php
Last active August 29, 2015 14:25
'Controller::beforeFilter' implementation in CodeIgniter2 example
<?php # File: application/config/hooks.php
# . . .
$hook['post_controller_constructor'] = [
'class' => 'ControllerHook',
'function' => 'beforeFilter',
'filename' => 'controller.php',
'filepath' => 'hooks',
'params' => []
@nelson6e65
nelson6e65 / Human.php
Last active March 19, 2016 19:20
php_nml v0.5.1: Reproduce issue when customized getter/setter prefixes (https://github.com/nelson6e65/php_nml/issues/9)
<?php
namespace AwesomeNamespace {
use NelsonMartell\Utilities\UnitTesting\Assert;
use NelsonMartell\Object;
use NelsonMartell\PropertiesHandler;
class Human extends Object {
use PropertiesHandler;
@DarrenN
DarrenN / get-npm-package-version
Last active May 2, 2025 08:59 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@alfredoem
alfredoem / pdf-example.blade.php
Created November 3, 2015 19:17
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@alexcorvi
alexcorvi / mime2ext.php
Created June 29, 2016 10:04
converting mime types to extension in php
function mime2ext($mime){
$all_mimes = '{"png":["image\/png","image\/x-png"],"bmp":["image\/bmp","image\/x-bmp","image\/x-bitmap","image\/x-xbitmap","image\/x-win-bitmap","image\/x-windows-bmp","image\/ms-bmp","image\/x-ms-bmp","application\/bmp","application\/x-bmp","application\/x-win-bitmap"],"gif":["image\/gif"],"jpeg":["image\/jpeg","image\/pjpeg"],"xspf":["application\/xspf+xml"],"vlc":["application\/videolan"],"wmv":["video\/x-ms-wmv","video\/x-ms-asf"],"au":["audio\/x-au"],"ac3":["audio\/ac3"],"flac":["audio\/x-flac"],"ogg":["audio\/ogg","video\/ogg","application\/ogg"],"kmz":["application\/vnd.google-earth.kmz"],"kml":["application\/vnd.google-earth.kml+xml"],"rtx":["text\/richtext"],"rtf":["text\/rtf"],"jar":["application\/java-archive","application\/x-java-application","application\/x-jar"],"zip":["application\/x-zip","application\/zip","application\/x-zip-compressed","application\/s-compressed","multipart\/x-zip"],"7zip":["application\/x-compressed"],"xml":["application\/xml","text\/xml"],"svg":
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@nelson6e65
nelson6e65 / git.md
Last active April 7, 2017 15:21
Git

Instalación a partir del Código Fuente

Info original: https://git-scm.com/book/es/v2/Inicio---Sobre-el-Control-de-Versiones-Instalaci%C3%B3n-de-Git

Algunas personas desean instalar Git a partir de su código fuente debido a que obtendrás una versión más reciente. Los instaladores binarios tienen a estar un poco atrasados. Sin embargo, esto ha hecho muy poca diferencia a medida que Git ha madurado en los últimos años.

Para instalar Git desde el código fuente necesitas tener las siguientes librerías de las que Git depende: curl, zlib, openssl, expat y libiconv. Por ejemplo, si estás en un sistema que tiene yum (como Fedora) o apt-get (como un sistema basado en Debian), puedes usar estos comandos para instalar todas las dependencias:

Fedora

@kuroisuna
kuroisuna / response_macros_service_provider.php
Created September 15, 2016 18:30
LARAVEL: Nicer responses with Response Macros
<?php
/** USAGE:
* return response()->success($data);
* return response()->notFound();
* return response()->created($createdResource);
* return response()->error($errorMessage, $errorCode);
*/
use Symfony\Component\HttpFoundation\Response as ResponseCode;