Skip to content

Instantly share code, notes, and snippets.

@enlacee
enlacee / query.php
Created September 5, 2014 23:36
query
<?php
if ($flag && is_array($array) && count($array) > 0) {
$fields = '';
$values = '';
foreach ($array as $key => $value) {
$fields = "$key,";
$values = "'$value',";
$oldmask = umask(0);
mkdir("test", 0777);
umask($oldmask);
@enlacee
enlacee / renameFilePatron.js
Created September 12, 2014 09:15
renombrar un archivo conel siguiente patron file__0__.txt = file.txt
/*
*
* return name sin __
*/
function renameFileNameInSession(name) {
var rename = name;
var patt = /\w*__(\d*)__.{3,4}/;
var result = patt.test(name);
if (result) {
/*
* validar patron file__101__.txt
*/
var patt = /\w*__(\d*)__\.\w{3,4}/;
@enlacee
enlacee / mysql-utf8.sh
Created November 1, 2014 06:21
MySQL utf8 configuration
# create databse sql
CREATE DATABASE mydb
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
# config in server mysql
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
@enlacee
enlacee / curl_php.php
Last active August 29, 2015 14:08
my cron request to any website
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ref : http://davidwalsh.name/curl-post
// ref2: http://www.silverphp.com/php-curl-function-for-post-and-get-request.html
class Cron extends MY_Controller {
/**
*
*/
#!/bin/bash
### Install Redmine (http://www.redmine.org) from scratch
### This script is intended for Ubuntu/Debian-based systems
### Copyright (c) 2014, Nikolay Khodov (https://github.com/nikolaykhodov)
### All rights reserved.
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are
@enlacee
enlacee / eliminar-ultimo-caracter.php
Created February 6, 2015 04:51
eliminar ultimo caracter php ,js
<?php $string = '';
foreach ($point as $key => $arreglo) {
foreach($arreglo as $indice => $value) {
$string .= "{x:".$arreglo['x'].", y:".$arreglo['y'].", value:50},"; continue;
}
}
if($string != '') {
$string = substr($string, 0, -1);
}
?>
@enlacee
enlacee / configurar-router-zf2.php
Created February 7, 2015 05:03
configuracion de router zf2
<?php
// http://localhost/iglesia-bb/public/persona/index/123
// http://localhost/iglesia-bb/public/persona/index/123/enlacee-
'router' => array(
'routes' => array(
'Persona' => array(
'type' => 'Literal',
'options' => array(
'route' => '/persona',
@enlacee
enlacee / asistemas.update01.txt
Last active August 29, 2015 14:15
asistemas.update01.txt
.ico-detail-see-more {
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
top: 3px;
font-size: 18px;
}