############~C~#############
if ((1?1:var)/2) {
/* it's floating point */
} else {
/* it's an integer */
}
#######~Objective-C~######## + (NSString *) append:(id) first, ...
{
NSString * result = @"";
id eachArg;
va_list alist;
if(first)
{
result = [result stringByAppendingString:first];
va_start(alist, first);
while (eachArg = va_arg(alist, id))
result = [result stringByAppendingString:eachArg];
va_end(alist);
}
return result;
}
#########~PHP~############## $object = new StdClass;
$object->foo = 'bar';
echo json_encode($object);
############################I know they aren't the best example, but I would love to be able to scan through a list of small code snippets (by language) that demonstrate concepts. On the plus side, it would be an easier way to show some competence in a language (for future employers) than having to do massive contributions to open source projects (don't have that much free time). The thing that makes or breaks this project is a smallish limit on lines. Without it, you are just another Gist/Pastebin, without the benefits of the wide user base and additional features. I have zero desire to chill at night and scan through a bunch of random 100+ line snippets that I have no context for, but I love goofing around on Stackoverflow, looking at fancy code snippets
https://coderwall.com/n/python https://coderwall.com/n/ruby https://coderwall.com/n/haskell
if var is a float...
(1?1:var)/2
...becomes... (1.0/2)
...which equals 0.5 and is considered true when evaluated. But if var is an int... (1?1:var)/2
...becomes... (1/2)
...which equals 0 and is considered false when evaluatedIt's a funny idea, I like it!
I'm working on a project and I'm considering using a wood grain background for a specific UX, but I'm not a designer and have been postponing making any decisions about it.
Most of all, I just get this visceral sense that wood grain is sort of distasteful, and that plain backgrounds are more aesthetically pleasing.
I'm actually going to try and redesign this as my case study for this weekend, thanks for sharing!
Facebook is going to buy it for 50 million dollars.
Also I think a great purpose for this would be to highlight particular bits of code/changes found in git, even if it is just a part of a gist.
Only one column layout isn't the best idea for such site. Maybe 3 thumbnail in a row would be better?