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
def callee(arg) | |
path = arg.path if arg.respond_to?(:path) | |
path ||= arg.to_path if arg.respond_to?(:to_path) | |
path ||= arg.to_str if arg.respond_to?(:to_str) | |
raise "Invalid path `#{arg}`" unless path | |
# ... do something with path | |
end |
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
rscript.stack <- function() | |
{ | |
# Returns the stack of Rscript files. | |
# | |
# Returns: | |
# Stack of files. | |
Filter(Negate(is.null), lapply(sys.frames(), function(x) x$ofile)) | |
} |
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
#include <assert.h> | |
#include <stdbool.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <sys/sysctl.h> | |
static bool AmIBeingDebugged(void) | |
// Returns true if the current process is being debugged (either | |
// running under the debugger or has a debugger attached post facto). | |
{ |
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
import "fmt" | |
func main() { | |
c1 = make(chan string) | |
c2 = make(chan T) | |
c3 = make(chan U) | |
go readStuff(c1) | |
go parseStuff(c1, c2) | |
go calculateStuff(c2, c3) | |
for value := range c4 { |
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
a[href^="http:"] { | |
display:inline-block; | |
padding-right:14px; | |
background:transparent url(/Images/ExternalLink.gif) center right no-repeat; | |
} | |
a[href^="mailto:"] { | |
display:inline-block; | |
padding-left:20px; | |
line-height:18px; | |
background:transparent url(/Images/MailTo.gif) center left no-repeat; |
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
The MIT License (MIT) | |
Copyright © 2013 Lee Dohm, Lifted Studios | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the “Software”), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
def hello | |
puts 'Hello' | |
end | |
# a equals nil and prints 'Hello' | |
a = true && hello | |
# b equals false | |
b = false && hello |
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
class A | |
{ | |
private B b; | |
public A(B b) | |
{ | |
this.b = b; | |
} | |
public void store() |
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
# Indicates whether `color` is a valid SVG color string. | |
# | |
# [SVG color descriptions](http://www.w3.org/TR/SVG/types.html#DataTypeColor) are one of the following: | |
# | |
# * RGB values | |
# * `#rgb` | |
# * `#rrggbb` | |
# * `rgb(255, 0, 0)` - *not currently supported by KangaRuby* | |
# * `rgb(100%, 0%, 0%)` - *not currently supported by KangaRuby* | |
# * [Color names](http://www.w3.org/TR/SVG/types.html#ColorKeywords) |
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
Get-Content -Encoding byte test.rb |
OlderNewer