Skip to content

Instantly share code, notes, and snippets.

View heanfig's full-sized avatar

Herman Andres Figueroa heanfig

View GitHub Profile
<?php
//Envio 8 de mayo de 2017
$m = array(
"3002352132",
"3002476807",
"3003195381",
"3003338429",
"3003688627",
"3003995796",
"3004635014",
@heanfig
heanfig / fibonacci-generator.js
Created October 24, 2017 03:30 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0;
let next = 1;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
}
}
<?php
// This variable value is passed to our function
$bookable_total = 1;
function woo_add_cart_fee( $bookable_total = 0 ) {
//global $bookable_total;
/*if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;*/
@heanfig
heanfig / foo.js
Created February 18, 2018 17:50 — forked from vvgomes/foo.js
Ramda vs Lodash
var _ = require("lodash");
var R = require("ramda");
var companies = [
{ name: "tw", since: 1993 },
{ name: "pucrs", since: 1930 },
{ name: "tw br", since: 2009 }
];
var r1 = _(companies).chain()
@heanfig
heanfig / xampp_php7_xdebug.md
Created March 12, 2018 23:23 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@heanfig
heanfig / app.js
Created March 27, 2018 01:52
ajax http
app.config(function($httpProvider) {
/**
* The workhorse; converts an object to x-www-form-urlencoded serialization.
* @param {Object} obj
* @return {String}
*/
var param = function (obj) {
var query = '', name, value, fullSubName, subName, subValue, innerObj, i;
var $routeControllers= "includes/controllers.php";
var $routeControlleri= "includes/controlleri.php";
var $routeControlleru= "includes/controlleru.php";
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider,$httpProvider) {
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
<?php
$dominio = 'Area restringida';
// usuario => contraseña
$usuarios = array('admin' => 'micontraseña', 'invitado' => 'invitado');
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Digest realm="'.$dominio.
/**
* @internal never define functions inside callbacks.
* these functions could be run multiple times; this would result in a fatal error.
*/
/**
* custom option and settings
*/
function wporg_settings_init() {
// register a new setting for "wporg" page
Organization name: [email protected]
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k