by abemassry on 1/2/13, 3:14 PM with 38 comments
by JoeCortopassi on 1/2/13, 4:40 PM
############~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
by ruswick on 1/2/13, 4:36 PM
by Hawkee on 1/2/13, 4:30 PM
by justjimmy on 1/2/13, 5:57 PM
I'm actually going to try and redesign this as my case study for this weekend, thanks for sharing!
by mjt0229 on 1/2/13, 4:26 PM
by prezjordan on 1/2/13, 3:45 PM
by travisby on 1/2/13, 5:08 PM
by jvictor118 on 1/2/13, 3:47 PM
by solox3 on 1/2/13, 4:28 PM
by m_pagliazzi on 1/2/13, 3:45 PM
by sturmeh on 1/2/13, 4:55 PM
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.
by sundara on 1/2/13, 7:50 PM
by vojant on 1/2/13, 7:14 PM
Only one column layout isn't the best idea for such site. Maybe 3 thumbnail in a row would be better?
by intermeddle on 1/2/13, 8:05 PM
by rmanyari on 1/2/13, 4:30 PM
by pablasso on 1/2/13, 8:31 PM
by cpdean on 1/2/13, 5:26 PM
by shuzchen on 1/2/13, 11:25 PM
by smonte on 1/2/13, 9:42 PM
by thomasvendetta on 1/2/13, 3:44 PM
by bennyg on 1/2/13, 5:47 PM