This file contains 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 Dog < Animal | |
def pet | |
dog_petter.pet | |
end | |
private | |
def dog_petter | |
DogPetter.new | |
end | |
end |
This file contains 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
function activarFormulario(){ | |
var form = document.querySelector("form"); | |
form.addEventListener("submit", function(event) { | |
event.preventDefault(); | |
var r = document.getElementById("result"); | |
var n = document.getElementById("GET-nombre"); | |
r.textContent = n.value; | |
}); | |
} |
This file contains 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
syntax on | |
autocmd Filetype html setlocal ts=2 sw=2 expandtab | |
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab | |
autocmd Filetype javascript setlocal ts=2 sw=2 expandtab | |
autocmd Filetype cucumber setlocal ts=2 sw=2 expandtab | |
set noswapfile | |
au BufRead,BufNewFile *.md set filetype=markdown | |
au BufRead,BufNewFile *.md.html set filetype=markdown |
This file contains 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
import threading | |
def daemonize(f): | |
def wrapper(*args, **kwargs): | |
tgt = f | |
t= threading.Thread(target=tgt, args=args, kwargs=kwargs) | |
t.setDaemon(True) | |
t.start() | |
return wrapper | |
#and you use it like this: |
This file contains 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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[remote "origin"] | |
url = git@github.com:you/HelloRadWorld.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[remote "gitorious_backup"] | |
url = git@gitorious.org:you/HelloRadWorld.git |
This file contains 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
$(function(){ | |
var converter = new Showdown.converter(); | |
function update_description_preview(){ | |
$('#preview').html(converter.makeHtml($("#id_body").val())); | |
} | |
$("#id_body").keyup(function(){ | |
update_description_preview(); | |
}); | |
}); |
This file contains 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
WSGIPythonEggs /var/root/ | |
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
WSGIApplicationGroup %{GLOBAL} | |
WSGIScriptAlias / /home/ruta/a/proyecto/django.wsgi | |
WSGIPassAuthorization On | |
DocumentRoot /var/www | |
Alias /static/ /home/ruta/a/proyecto/static/ | |
<Directory /home/ruta/a/proyecto/static> |
This file contains 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 OhMyGod | |
constructor: (@name)-> | |
setInterval(-> | |
alert "I'm"+@name+" and I annoy" | |
,3000) | |
divide: (n1, n2)-> | |
n1/n2 unless n2 is 0 and n1? |
This file contains 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
var OhMyGod; | |
OhMyGod = function(_a) { | |
this.name = _a; | |
setInterval(function() { | |
return alert("I'm"+this.name+"I annoy"); | |
}, 3000); | |
return this; | |
}; | |
OhMyGod.prototype.divide = function(n1, n2) { | |
if (!(n2 === 0 && (typeof n1 !== "undefined" && n1 !== null))) { |
This file contains 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
:javascript | |
var disqus_shortname = 'YOUR-SITE'; | |
(function () { | |
var s = document.createElement('script'); s.async = true; | |
s.src = 'http://disqus.com/forums/YOUR-SITE/count.js'; | |
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); | |
}()); |
OlderNewer