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
-- http://www.jasq.org/2/post/2012/05/inverse-fizzbuzz.html | |
import Control.Applicative -- para <*> | |
import Data.List -- para sortBy | |
import qualified Data.Map as M | |
divides m n = n `mod` m == 0 | |
fizzbuzzTest n = [divides 3, divides 5] <*> [n] |
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
/* Este factorial es recursivo, pero operamos de alguna forma la | |
* llamada recursiva (la multiplicamos por n). | |
*/ | |
long factorial(long n) { | |
if (n == 0) { | |
return 1; | |
} | |
else { | |
return n * factorial(n-1); |
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
<html> | |
<head> | |
<title> ¡Hola! </title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var server = io.connect('http://localhost:8080'); | |
document.onkeypress = manda; | |
function manda(event) { |
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
def is_ancestor_of?(other_page) | |
other_page.is_descendant_of? self | |
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
import Control.Monad | |
import Data.List | |
let unRoll = join .map (uncurry $ flip replicate) | |
let roll = map $ map (\l@(x:_) -> (x, length l)) . group:: [String] -> [[(Char, Int)]] | |
let powerSet = roll . nub . filterM (const [True, False]) . unRoll | |
powerSet [('a',2), ('b',2)] |
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
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $ | |
# | |
# By Nicholas Marriott. Public domain. | |
# | |
# This configuration file binds many of the common GNU screen key bindings to | |
# appropriate tmux key bindings. Note that for some key bindings there is no | |
# tmux analogue and also that this set omits binding some commands available in | |
# tmux but not in screen. | |
# | |
# Note this is only a selection of key bindings and they are in addition to the |
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
for i in `find .`; do echo $i `grep -c PATTERN $i` | awk '{ if ($2 > 1) print $1}' ; done |
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
for i in `ls -rt DIRECTORY`; do; if [ -f DIRECTORY/$i ]; then grep -H PATTERN DIRECTORY/$i; fi; done |
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 gdbTest; | |
import org.neo4j.jdbc.Driver; | |
import org.neo4j.jdbc.Neo4jConnection; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.Properties; | |
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
!#/bin/bash | |
/usr/local/bin/emacsclient -c "$@" |
OlderNewer