Skip to content

Instantly share code, notes, and snippets.

-- Adminer 4.1.0 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `heatmap`;
CREATE TABLE `heatmap` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@enlacee
enlacee / function_serialize.php
Last active August 29, 2015 14:06
function_serialize
<?php
// function order array
private static function _getSerialDataSubstitute($data, $extraArray = null)
{
$array = array();
//$data = !empty($data[0]) ? $data[0] : array();
$c = 0;
if (is_array($data) && count($data) > 0) {
@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);
}
?>