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
| defmodule Bottles do | |
| @moduledoc """ | |
| Will print the lyrics for the song 99 bottles of beer on the wall. | |
| See `Bottles.sing` and `Bottles.create_stream` for usage examples. | |
| """ | |
| @doc """ | |
| `Bottles.sing`, given a number, will print the lyrics for that verse. | |
| If it is given a range it will print all the verses between these |
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
| (lc suit inlist [:hearts, :spades, :diamonds, :clubs], value inlist [1,2,3,4,5,6,7,8,9,:j,:q,:k,:a], do: {:card, suit, value}) |> Enum.shuffle |> Enum.take 5 |
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
| // npm install pursuit-core | |
| // npm install pursuit-dictionary | |
| var pursuitCore = require('pursuit-core'), | |
| dictionary = require('pursuit-dictionary') | |
| ; | |
| // add a random function to the dictionary | |
| dictionary.random = function() { | |
| return 'Math.random() - 0.5 > 0 ? true : false'; |
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
| /node_modules/ | |
| /docs/ | |
| /benchmarks/results.csv |
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
| function encryptROT13 (message) { | |
| var input = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', | |
| output = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm', | |
| rtn = [], | |
| i | |
| ; | |
| for (i in message) { | |
| rtn[i] = output[input.indexOf(message[i])] || message[i]; | |
| } |
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
| (defun say nil | |
| "Speak region." | |
| (interactive) | |
| (let (arg) | |
| (if mark-active | |
| (setq arg (buffer-substring (region-beginning) (region-end))) | |
| (setq arg (read-from-minibuffer "Say: "))) | |
| (save-window-excursion | |
| (async-shell-command (format "say \"%s\" &" arg))))) |
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
| (defun duckduckgo nil | |
| "Duck Duck Go something." | |
| (interactive) | |
| (let (arg) | |
| (if mark-active | |
| (setq arg (buffer-substring (region-beginning) (region-end))) | |
| (setq arg (read-from-minibuffer "Search term: "))) | |
| (browse-url (format "http://duckduckgo.com/?q=%s" arg)))) |
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
| (function(w,r,i){r=[];for(i in w)r.push(w.charCodeAt(i).toString(2));return r.join(' ');}('hello, world')) |
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
| (function(w,r,i){r="",w=w.split(" ");for(i in w){r+=String.fromCharCode(parseInt(w[i],2));};return r;}('1101000 1100101 1101100 1101100 1101111 101100 100000 1110111 1101111 1110010 1101100 1100100')) |
NewerOlder