Skip to content

Instantly share code, notes, and snippets.

@alfchee
alfchee / DragNDrop
Last active Aug 29, 2015
Drag some information from a <table> to a div and make it an item of a list-group of twitter bootstrap. Uses jQuery and Underscore
View DragNDrop
/// About DragNDrop for....
/// LocalStorage para las operaciones a consolidar
// recuperación del localStorage
aConsolidar = JSON.parse(localStorage.getItem('aConsolidar'));
// si no existe se crea un array sin contenido
if(aConsolidar === null) {
aConsolidar = [];
} else {
View ElasticSearch.sh
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
View global.php
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
View cIP
<?php
/**
$Id: cIP.php,v 1.0 2010/10/14 20:07:04 laudarch Exp $
Author: Archzilon Eshun-Davies
URL: http://www.phpclasses.org/package/8494-PHP-Determine-the-IP-address-of-the-user-from-headers.html
License: BSD License
PHP v: 5.0
*/
# Set to true if you want to test the class
@alfchee
alfchee / invitacion_dcora
Last active Aug 29, 2015
Invitación de D'Cora
View invitacion_dcora
<html>
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Lato:300|Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body>
<style>
/*@import url(http://fonts.googleapis.com/css?family=Lato|Open+Sans:300italic);*/
body {
@alfchee
alfchee / NumeroALetras.js
Last active Sep 26, 2022
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
View NumeroALetras.js
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@alfchee
alfchee / TP_Camera
Created Sep 25, 2015
Is a Third Person Camera that allows to brings to the Main Camera of an scene in Unity3D to follow the main character that have a lookAt object in it's hierarchy
View TP_Camera
using UnityEngine;
using System.Collections;
public class TP_Camera : MonoBehaviour
{
public static TP_Camera Instance;
public Transform TargetLookAt;
public float Distance = 5f;
public float DistanceMin = 3f;
@alfchee
alfchee / AbstractModel.php
Created Oct 2, 2015
It's an abstract class that works magic methods and properties
View AbstractModel.php
<?php
class AbstractModel {
protected $fillable = array();
protected $data = array();
// set magicaly the data attributes
protected function __set($name,$value) {
$this->data[$name] = $value;
@alfchee
alfchee / topkeywords.js
Created Oct 6, 2015 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
View topkeywords.js
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@alfchee
alfchee / ThreadingPHP
Created Oct 7, 2015
Chunks de código de intento de PHP asíncrono o con threadings para obtener contenido de un site
View ThreadingPHP
use GuzzleHttp\Client;
$request = new AsyncWebRequest($this->_url,$url);
if($request->start()) {
while($request->isRunning()) {
usleep(30);
}
if($request->join()) {