enlacee
enlacee
Reputation Top 1%
pepe rios
19 Snippets  (39th place)
Published
1 Channel
Created
2 Channels
Following
438 points  (71st place)
Reputation
Top 10% Publisher
Senior Code Generator
Junior Popular Coder
Junior Autobiographer
Senior Autobiographer
Senior Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by enlacee

public by anibal copitan (pepe)  1870  0  3  0

CTRL CLICK en jacascript

CTRL CLICK en jacascript: event.click.riotjs.js
var $grid_container = $('#grid_container', this.root);
$grid_container
	.on ('click', '.item', function (e) {
		if (e.metaKey || e.ctrlKey) {
			$('input', e.currentTarget).click();
		} else {
			me.elegirItemActual(e);
		}
	});
})

;

public by enlacee  1317  0  3  0

Herencia riotjs

Herencia riotjs: herencia.js.riotjs.js
// Modelo genérico
// herencia con riotjs
	function AjaxModel(url) {
		riot.observable(this);
		this.url = url;
	};

/**
* Class
*/
	function cur_item(url) {
		this.url = url;
		console.log('init constructor URL', url);
	}

	cur_item.prototype = new AjaxModel(cur_item.url);

	// Events
	cur_item.prototype.on('updated', function(status) {
		console.log('event updated');
		env['tag-inspector'].trigger('mostrarDatos', env.cur_item);
	});

	// Functions
	cur_item.prototype.abrirInspector = function(event, url) {
		console.log("dd")
		this.load(url).then(function(event) {
			env['tag-inspector'].mostrarVentana(event);
		});
	};

	cur_item.prototype.saludar = function() {
		console.log ("hi! cur_item")
	}


;

public by anibal copitan (pepe)  2078  7  3  0

Create SVG with HTML and JS

Create SVG with HTML and JS: svg-with-html-and-js.js
var image = 'http://jenkov.com/images/layout/top-bar-logo.png';
var svgimg = document.createElementNS('http://www.w3.org/2000/svg','image');
svgimg.setAttributeNS(null,'height','80');
svgimg.setAttributeNS(null,'width','300');
svgimg.setAttributeNS('http://www.w3.org/1999/xlink','href', image);
svgimg.setAttributeNS(null,'x','0');
svgimg.setAttributeNS(null,'y','0');
svgimg.setAttributeNS(null, 'visibility', 'visible');
svgimg.setAttributeNS(null, 'transform','translate(105,140) rotate(-15) translate(-96,-156)');
//tag.root.children[0].children[0].appendChild(svgimg);


;

public by enlacee  992  0  3  0

recursividad javascript (memonation)

recursividad javascript (memonation): recursividad.con.cache.js
var f = [];
function factorial (n) {
  if (n == 0 || n == 1)
    return 1;
  if (f[n] > 0)
    return f[n];
  return f[n] = factorial(n-1) * n;
}
//@souce:http://goo.gl/4rZ4xX

;

public by enlacee  1500  0  3  0

how to config access for IP ADDRESS (wordpress)

how to config access for IP ADDRESS (wordpress): .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

## only acces to this IP HOUSE
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^190\.238\.253\.9$
RewriteCond %{REMOTE_ADDR} !^190\.233\.226\.164$
RewriteRule ^(.*)$ - [R=404,L]

## no edit config
<files wp-config.php>
order allow,deny
deny from all
</files>

</IfModule>

# END WordPress


;