Created
August 23, 2009 12:05
-
-
Save jedediah/173251 to your computer and use it in GitHub Desktop.
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 is the CSS found in embedded gists from Github. | |
* The descriptions are Ruby specific but other languages | |
* likely use similar schemes. | |
*/ | |
.gist /* entire embedded box */ | |
#gist-? /* specific .gist box, ? is numeric gist id */ | |
.gist-file /* one file */ | |
.gist-data /* code box */ | |
.gist-syntax /* same as .gist-data(?) */ | |
.gist-highlight /* only child of .gist-data */ | |
.gist-meta /* bottom box with links */ | |
.line /* one line of code */ | |
#LC? /* specific line number ? */ | |
.p /* some punctuation: , ; () {} */ | |
.o /* most punctuation operators including [] */ | |
.ow /* word operators: and, or, not */ | |
.s1 /* 'single-quoted string' */ | |
.s2 /* "double-quoted string" */ | |
.ss /* :symbol */ | |
.sb /* `backticks` */ | |
.sc /* character literal: ?x */ | |
.sx /* block string and friends: | |
%{}, %s{}, %q{}, %w{}, %x{}, etc */ | |
.sh /* heredoc content (but not delimiters) */ | |
.sr /* regexp: /standard/ or %r{block} */ | |
.si /* string interpolation delimiters: #{ } */ | |
.se /* string escape sequences \n, \r, \t, etc */ | |
.mi /* decimal integer (or components of a float) */ | |
.mh /* hex integer: 0xf00 */ | |
.mo /* octal integer: 0700 */ | |
.m-Bin /* binary integer: 0b0101 */ | |
.k /* most keywords */ | |
.kp /* some other keywords: public, private, | |
attr_accessor, nil, true, false */ | |
.nb /* a few special variables (self, hash, ??) */ | |
.nn /* module name (declaration only) */ | |
.nc /* class name (declarations only) */ | |
.nf /* function name (declaration only) */ | |
.no /* capitalized name: Class, Module, CONST */ | |
.n /* lower case name: locals, method.calls, | |
(formal, arguments), etc */ | |
.vi /* instance variable: @foo */ | |
.vc /* class variable: @@foo */ | |
.vg /* global variable: $foo */ | |
.c1 /* line comment: # foo */ | |
.cm /* block comment: =begin ... =end */ | |
.bp /* __FILE__, __LINE__ */ | |
.cp /* __END__ and following data section */ |
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 | |
# line comment | |
=begin | |
block comment | |
=end | |
module ModuleDecl | |
class ClassDecl | |
private | |
public | |
protected | |
attr_accessor :attribute | |
alias some_func, other_func | |
def function_decl formal, arguments | |
{:hash => table} | |
{newstyle: hash} | |
[@ivar,@@cvar,$gvar,ident,ClassRef,CONST_REF] | |
[true,false,self,nil] | |
[1,-2,3_333_333,3.14159,1.2e-3,0xf00,0700,0b10101,1..10] | |
['string',"interp",:symbol,/regexp/,`syscall`,?c,?\M-\C-a] | |
"string #{with} stuff\uabcd\M-x\n" | |
[%{block string},%[alternate delims],%,tricky delims,] | |
%q{non-interpolated block string} | |
%w{word list} | |
%s{block symbol} | |
%r{block regexp} | |
%x{block syscall} | |
:"quoted symbol" | |
<<-HEREDOC | |
Stuff in heredoc. | |
HEREDOC | |
object.method(argu, ments, :keyword => arguments) {|block, formals|} | |
if a then b else c end | |
fun_call(argu,ments); predicate?; mutator! | |
Scoped::ClassRef; Scoped::CONST_REF | |
a and b or not c | |
assign = ment | |
multi, ple = assign, ment | |
__FILE__; __LINE__ | |
end | |
end | |
end | |
__END__ | |
All work and no play makes Jack a dull boy. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment