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
<a href="javascript:get();">Get comments</a> |
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
/* This sample uses jQuery */ | |
/* This doesn't work. | |
* | |
* Here, notice the success callback uses the data variable, except when called, | |
* the anonymous function can't access the data variable, since it's defined within | |
* the scope of the anonymous object that's sent to the request() method. | |
*/ | |
function someEvent(event) { | |
var data = { 'update-success' : "result_list", 'update-failure' : "error_list" }; |
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
1 times: | |
"Hello world!\n" print | |
. |
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
1 times: | |
about("_why") print | |
about("stage fright") print | |
. |
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
["Two", "Birds", "In", "Hand"].each_with_index.map { |element, index| | |
"#{element}: #{index}" | |
} | |
# => ["Two: 0", "Birds: 1", "In: 2", "Hand: 3"] |
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
#!/usr/bin/ruby | |
class Encrypter | |
private | |
def value(symbol) | |
return 53 if symbol == "A" or symbol == "B" | |
return symbol.to_i | |
end | |
def triple_cut |
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
<!-- Changes this into a div placeholder --> | |
<img class="lorem" data-size="200x100" /> |
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
<!-- When you want to set the color --> | |
<img class="lorem" data-size="100x100" data-color="#ddd" /> | |
<!-- Or when you want some other styles along with it --> | |
<img class="lorem" data-size="100x100" style="margin: 10px" /> | |
<!-- Or if you want to override something --> | |
<img class="lorem" data-size="100x100" style="border: 0px solid black" /> |
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
-module(guess). | |
-export([start/0]). | |
start() -> | |
intro(6). | |
intro(Guesses) -> | |
io:format("Welcome to the Guessing game!\n"), | |
io:format("I'm thinking of a number between 1 and 20\n"), | |
get_guess(Guesses, random:uniform(20)). |
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
bash-3.2$ for f in *.html; do mv $f `basename $f .html`.erb ; done |