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 = [email protected]:you/HelloRadWorld.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[remote "gitorious_backup"] | |
url = [email protected]: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); | |
}()); |
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
#to also process text files | |
./manage.py makemessages -ae ".html" -e ".py" -e ".txt" |
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
require 'sinatra' | |
get '/' do | |
"¡hola mundo!" | |
end | |
get '/agua' do | |
send_file "hola.html" | |
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
package ejercicios; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
public class Conjuntos{ | |
private static ArrayList<String> union1(ArrayList<String> primero, ArrayList<String> segundo){ | |
ArrayList<String> retVal = new ArrayList<String>(primero); | |
for(String worte: segundo){ | |
if(!primero.contains(worte)) | |
retVal.add(worte); |
OlderNewer