Skip to content

Instantly share code, notes, and snippets.

View alejandrolechuga's full-sized avatar
🤯
Focusing

neptuno alejandrolechuga

🤯
Focusing
View GitHub Profile
@alejandrolechuga
alejandrolechuga / ObjectPropertiesChecker.js
Created March 23, 2011 00:41
Object Property Checker
//Just in case is not supported or not included by your framework
//***************************************************
Array.prototype.some = function(fn, thisObj) {
var scope = thisObj || window;
for ( var i=0, j=this.length; i < j; ++i ) {
if ( fn.call(scope, this[i], i, this) ) {
return true;
}
}
return false;
/**
1.-Write a server script to read your file contents from a url
2.-Remove breaklines
3.-Place it on JS variable
4.-Output the html string as you want, document.write embeds
5.-Embed it using the script tag
<script type="text/javascript" src="myScript.php"></script>
*/
var htmlString ="<h1>Red Dot Avatar</h1>\n<br>\n<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==\" alt=\"red dot\">";
document.write(htmlString);
@alejandrolechuga
alejandrolechuga / content.html
Created November 18, 2011 01:51
embeding external script cross-subdomain
<!--file content site B-->
<h1>Red Dot Avatar</h1>
<br>
<img src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
vr4MkhoXe0rZigAAAABJRU5ErkJggg==" alt="red dot">
var Vector2d = function () {
this.x = arguments[0] || 0;
this.y = arguments[1] || 0;
/**
* @method: setX
* @param: int
*/
this.setX = function (x) {
{
"placement":2274,
"results":3,
"videos":[
{
"title":"Sponsored: Dannon Oikos | The Tease",
"creative":4050,
"description":"Watch the Dannon Oikos ad from the Big Game featuring John Stamos",
"thumb_url":"http://cdn.visiblemeasures.com/ad_assets/p/c306/Oikos_EndSplash_300x250.jpg",
"pixels":{
<?php
if ($_GET['key'] == $_SESSION['hash_key']) {
//has key validation passed
}
?>
<?php
$months = array();
$months [] = "Enero";
$months [] = "Febrero";
$months [] = "Febrero";
$months [] = "Marzo";
$months [] = "Abril";
$months [] = "Mayo";
$months [] = "Junio";
function convertir($fecha) {
$months = array();
$months [] = "Enero";
$months [] = "Febrero";
$months [] = "Marzo";
$months [] = "Abril";
$months [] = "Mayo";
$months [] = "Junio";
$months [] = "Julio";
$months [] = "Agosto";
$(document).ready(function(){
$("somebutton").click(function(){
var one=$("someinput").val();
var two=$("someinput").val();
var three=$("someinput").val();
$.ajax({
url:'process.php',
type:'POST',
data:{blah1:one,blah2:two,blah3:three},
success:function(result){
//found on bootstrap plugins oO ?
!function(global){
}(this);
//Function wrapped and executed
(function(global){
})(this);