This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# move to your local branch | |
git checkout local_branch | |
# pull the remotes | |
git fetch --all | |
# merge and squash | |
git merge origin/dirty_branch --squash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Object with hidden values | |
*/ | |
var ObjectClosure = (function(){ | |
var privateValue = "hello there!!"; | |
return { | |
getValue: function(){ | |
return privateValue; | |
}, | |
setValue: function(newValue){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Hanoi recursive function | |
*/ | |
var hanoi = function(disc,src,aux,dest){ | |
if(disc > 0){ | |
hanoi(disc -1,src,dest,aux); | |
console.log('Move disc '+disc+' from '+src+' to '+dest); | |
hanoi(disc -1,aux,src,dest); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
No se si en en entendí to pregunta, pero me suena a estos posibles casos | |
*/ | |
// Herencia de un objeto | |
// padre | |
var Parent = (function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = new PDO('mysql:host=localhost;dbname=test', $user, $pass); | |
$sql = sprintf("SELECT contenido FROM barra_lateral WHERE 1 "); | |
echo '<div id="barra_lateral">'; | |
foreach($db->query($sql) as $row){ | |
echo '<div class="item">' . $row['contenido'] . '<br></div>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(($)-> | |
class Test | |
constructor:(@error = null)-> | |
log: -> | |
if window.log? and error is not null then console.log @error | |
select: -> | |
$elements = $("div") | |
$elements.on "click" , -> | |
### | |
En este momento @ = this es un elemento de jquery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(selector).bind("change", function() { | |
return $.ajax({ | |
success: function() { | |
return $(this).hide(function() { | |
return $(this).show("slow", function() { | |
return mainCallback(function() { | |
return alert("Hola Mundo"); | |
}); | |
}); | |
}); |
NewerOlder