Skip to content

Instantly share code, notes, and snippets.

View merolhack's full-sized avatar

Lenin Jose Meza Zarco merolhack

View GitHub Profile
@merolhack
merolhack / 6.0.- Readme.md
Last active January 24, 2024 15:01
REHL(CentOs & Oracle Linux) 6: Instalación de OCI8

High performance PHP applications with Oracle Database

The PHP OCI8 2.0 extension for Oracle Database is now "production" status. The source code is included in the latest PHP versions and is also available on PECL to update your OCI8 extension in PHP 5.2 and later versions. The extension compiles with Oracle 10.2 or later client libraries. Oracle's standard cross-version database connectivity applies, allowing PHP to connection to multiple versions of Oracle Database.

PHP OCI8 is part of the PHP open source project. It is maintained by Oracle, and is under active development.

PHP OCI8

@merolhack
merolhack / slugify.js
Last active May 29, 2023 11:30 — forked from mathewbyrne/slugify.js
Javascript Slugify: For accents and other latin characters
function slugify(text)
{
var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;";
var to = "aaaaaeeeeeiiiiooooouuuunc------";
_.each( from, function( character, i ) {
text = text.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
});
return text
.toString() // Cast to string
.toLowerCase() // Convert the string to lowercase letters
@merolhack
merolhack / backup-mysql.bat
Created April 14, 2016 15:56
Windows: Backup all databases in a MySQL server.
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
REM Windows Batch script to backup all mysql databases in a server
REM @author: Lenin Meza <lenin.meza.externo@prodecon.gob.mx>
REM Database information
SET dbhost="127.0.0.1"
SET dbuser="root"
@merolhack
merolhack / 7.1.- FreeTDS, UnixODBC, php-mssql
Last active December 15, 2021 07:45
REHL(CentOs & Oracle Linux): Conexión con SQL Server
# Instalación de FreeTDS y dependencias:
yum install freetds freetds-devel -y
# Instalación del módulo de PHP:
yum --enablerepo=remi install php-mssql -y
# Habilitar los siguientes booleanos:
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1
@merolhack
merolhack / centos7-set-drupal8-permissions.sh
Created December 7, 2016 20:01
Set SELinux, ACL and common permissions to Drupal 8 over CentOs 7
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
echo "0.- Reestablecer el contexto"
sudo restorecon -Rv /var/www/html
echo "1.- Cambiar propietario del webroot de Apache"
@merolhack
merolhack / app.js
Last active November 7, 2020 01:41 — forked from rnkoaa/app.js
A simple angularjs with angular-ui modal form which includes validation on the client side.Thanks http://scotch.io/tutorials/javascript/angularjs-form-validation
var app = angular.module("modalFormApp", ['ui.bootstrap']);
app.controller("modalAccountFormController", ['$scope', '$uibModal', '$log',
function ($scope, $uibModal, $log) {
$scope.showForm = function () {
$scope.message = "Show Form Button Clicked";
console.log($scope.message);
var uibModalInstance = $uibModal.open({
@merolhack
merolhack / readline.js
Created August 25, 2018 17:49
Read the user input
const mongoClient = require('mongodb').MongoClient;
const rl = require('readline');
const url = 'mongodb://localhost:27017';
const dbName = 'foo-bar';
const TWEETS_COLLECTION = 'tweets';
const USERS_COLLECTION = 'users';
const ask = function(question, callback) {
var r = rl.createInterface({
@merolhack
merolhack / axios-meetups.js
Last active July 7, 2018 17:32
ES6 Functional programming
const axios = require('axios');
// Declare a method to consume the API
const getMeetups = (lon, lat) => axios
.post('https://safemeet-back-jmedcxhwdp.now.sh', { lon, lat })
.then(({data}) => data);
// Call the method and get the name of each meetup
Promise.all([getMeetups(-103.4054534, 20.6737777), getMeetups(-99.1709761, 19.426063)])
.then((myArray) => {
@merolhack
merolhack / Arduino IDE - First steps.md
Created April 2, 2016 20:15
If Arduino cant open the USB
@merolhack
merolhack / Ionic 2 & AngularJs 2.markdown
Last active April 21, 2016 23:36
First steps with Ionic 2 and AngularJS 2 over Android device emulator

Download and install "Android Studio": http://developer.android.com/sdk/index.html

Ensure that have the next environment variables in your PATH: ANDROID_HOME JAVA_HOME

Create an Android device emulator with the "AVD Manager" or with: $ android avd