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' => []
@VenkataRaju
VenkataRaju / DynamicFormulaEvaluator.html
Last active September 1, 2015 12:51
Dynamic Formula Evaluator wtirren in HTML and JavaScript
<!DOCTYPE html>
<!-- Author: Venkata Raju -->
<!--
TODO: 1) Allow multi line in formula (mouse cursor up and down should work)
2) Resizeable table header resize: horizontal
-->
<html>
<meta charset="UTF-8">
<head>
<title>Dynamic Formula Evaluator</title>
@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;
@dhrrgn
dhrrgn / preg_grep_keys.php
Created June 19, 2013 19:47
preg_grep_keys() allows you to grep over the keys of an array.
<?php
function preg_grep_keys($pattern, $input) {
return preg_grep($pattern, array_keys($input));
}
@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;
@kuroisuna
kuroisuna / transpose_rows.sql
Last active September 17, 2016 04:04
SQL: Transposing rows without subqueries
-- Say we have this table called selected_colors:
-- +----------------+
-- | type | value |
-- +--------+-------+
-- | blue | 1 |
-- | red | 4 |
-- | yellow | 8 |
-- | red | 12 |
-- | blue | 5 |
-- | blue | 0 |
@JensRantil
JensRantil / handle_tab_links.js
Created February 6, 2013 10:50
Code that makes it possible to link directly to a nested (Bootstrap) tab. Also, see http://stackoverflow.com/questions/7862233/twitter-bootstrap-tabs-go-to-specific-tab-on-page-reload
@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

@Golit
Golit / busybox-vi-heroku.sh
Last active January 12, 2019 22:45
Edit files on heroku with busybox vi
#!/bin/bash
# Downloads busybox to run vi on heroku
# Tested on heroku-16
# Fetch the version of busybox in the alpine repository
VERSION=$(curl -s -L http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/x86_64/APKINDEX.tar.gz | tar -xzOf - APKINDEX | grep -A 12 -B 1 "^P:busybox-static$" | grep "^V:" | cut -c3-)
# Download busybox-static from the alpinelinux repository and extract the binary into /app/bin
# if the download fails visit the repository to check if the filename has changed
# The Output: