News for hackers. Stuff that matters.
Re:Show HN: My weekend project - Codestagram by JoeCortopassi on Wednesday January 02, 2013 @11:40AM (#4997485)
I would love this idea, if it was limited to 10-20 lines. The forced conciseness of it would make devs focus on brief concepts and structure, rather than complex methods. It would end up being like Dribble rather than Gist/PasteBin, and be a great place to browse for techniques I hadn't previously encountered. Think about how fun it would be to scan through an Instagram style list of stuff like this:

############~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

Re:Show HN: My weekend project - Codestagram by imkevinxu on Wednesday January 02, 2013 @03:23PM (#4999031)
I feel like I found what you are looking for from Coderwall's blogs, they tend to be short interesting snippets by language and sorted by popularity.

https://coderwall.com/n/python https://coderwall.com/n/ruby https://coderwall.com/n/haskell

Re:Show HN: My weekend project - Codestagram by randomdrake on Wednesday January 02, 2013 @05:00PM (#4999571)
Hyperpolyglot has some of this stuff. It doesn't provide particularly rich and deep examples, but it is an easily scannable list of small code snippets. If you haven't seen it already, you should take a look.

http://hyperpolyglot.org/scripting

Re:Show HN: My weekend project - Codestagram by xxpor on Wednesday January 02, 2013 @04:13PM (#4999347)
Quick question: wouldn't 1?1:var always return 1?
Re:Show HN: My weekend project - Codestagram by JoeCortopassi on Wednesday January 02, 2013 @04:58PM (#4999558)
Nope. Having '1' as the condition in the ternary operator, causes 'var' to never be evaluated (to avoid accidental operations with getters and such), but the compiler allows the 'var' to affect if the '1' is treated as a float or an int. Here's a breakdown:

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 evaluated
Re:Show HN: My weekend project - Codestagram by Groxx on Friday January 04, 2013 @12:01AM (#5006345)
Is that part of the spec for coercions, or is it exploiting a typical compiler's behavior? It certainly doesn't appear to be a required way to process that statement (optimizations could remove the 'if' portion entirely), unless it is actually required of the compiler.
Re:Show HN: My weekend project - Codestagram by ruswick on Wednesday January 02, 2013 @11:36AM (#4997469)
It's a nice novelty, but it certainly won't ever usurp Gists. I'm not sure that it was intended to. However, there is one aspect of the site that really irks me: the wood grain background. For whatever reason, this style has become really pervasive among "hacked-together" sites. Moreover, it sucks. The site would be better served with a geometric pattern, or no background at all.
Re:Show HN: My weekend project - Codestagram by saraid216 on Wednesday January 02, 2013 @05:29PM (#4999717)
Could you elaborate on why the wood grain background sucks?

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.

Re:Show HN: My weekend project - Codestagram by ruswick on Thursday January 03, 2013 @11:15AM (#5002975)
The organic pattern and light color are somewhat distracting. It also doesn't seem thematically consistant, and sort of belies the idea of a modern site focused on programming.

Most of all, I just get this visceral sense that wood grain is sort of distasteful, and that plain backgrounds are more aesthetically pleasing.

http://cl.ly/image/3R392H2g371t

Re:Show HN: My weekend project - Codestagram by saraid216 on Friday January 04, 2013 @04:08AM (#5006864)
Hm. I've been thinking about going with a darker wood. (And it is thematically consistent in my case, since my goal is to evoke the sense of an old, well-kept bookcase; the project has nothing to do with programming beyond, well, the fact that I'm coding it.)

I'll think about it. I'll pass it through people with actual skill at UX first, too.

Re:Show HN: My weekend project - Codestagram by Hawkee on Wednesday January 02, 2013 @11:30AM (#4997443)
So ACE editor + GitHub API + Commenting and Liking. It's a very, very simple concept. I think mainly what it has going for it is the limited barrier to entry. I'm just not sure what the long term sustainability is. Mainly its lacking the personal network aspect. I have no way of finding the developers I'm following on GitHub.
Re:Show HN: My weekend project - Codestagram by justjimmy on Wednesday January 02, 2013 @12:57PM (#4998018)
I see it more akin to Dribbble than Instagram. You could also introduce 'rebound' - which is improving/optimizing/add your personal touch to the 'shot' (uploaded image, or code in this case).

I'm actually going to try and redesign this as my case study for this weekend, thanks for sharing!

Re:Show HN: My weekend project - Codestagram by mnicole on Wednesday January 02, 2013 @01:38PM (#4998322)
Codepen.io and CSSDeck.com are the Dribbbles of code.
Re:Show HN: My weekend project - Codestagram by jamesjporter on Wednesday January 02, 2013 @03:18PM (#4999004)
Those are both focused exclusively on the web though. It would be cool to have something like those but for a wider community; there's more to programming than HTML/CSS/JS.
Re:Show HN: My weekend project - Codestagram by mnicole on Wednesday January 02, 2013 @03:32PM (#4999083)
Great point, my bad.
Re:Show HN: My weekend project - Codestagram by mjt0229 on Wednesday January 02, 2013 @11:26AM (#4997423)
If you want to hipster it up, you can convert the code to punchcards.
Re:Show HN: My weekend project - Codestagram by prezjordan on Wednesday January 02, 2013 @10:45AM (#4997202)
Not sure I understand. Is it just a pasteboard?
Re:Show HN: My weekend project - Codestagram by georgemcbay on Wednesday January 02, 2013 @06:47PM (#5000116)
No! It is a retro-text media social network for rockstar ninja coders.

Facebook is going to buy it for 50 million dollars.

Re:Show HN: My weekend project - Codestagram by travisby on Wednesday January 02, 2013 @12:08PM (#4997680)
I would benefit from a "copy" button. When I highlight the code snippet, I also got the line numbers with it. Would be a hassle for large codestagrams
Re:Show HN: My weekend project - Codestagram by jvictor118 on Wednesday January 02, 2013 @10:47AM (#4997208)
It'd be cooler if you could evaluate the expressions. I saw an API for save evaluation of user's code somewhere on reddit the other day, that might help
Re:Show HN: My weekend project - Codestagram by solox3 on Wednesday January 02, 2013 @11:28AM (#4997431)
So many solutions, so few problems :/
Re:Show HN: My weekend project - Codestagram by m_pagliazzi on Wednesday January 02, 2013 @10:45AM (#4997198)
Don't see the difference with github gists...
Re:Show HN: My weekend project - Codestagram by bvaldivielso on Wednesday January 02, 2013 @11:18AM (#4997375)
It's like github gists and instagram at the same time, because it let's you apply "filters" to your code (which are color palettes).

It's a funny idea, I like it!

Re:Show HN: My weekend project - Codestagram by Hawkee on Wednesday January 02, 2013 @12:33PM (#4997849)
Its a funny idea, but I'm not sure its all that useful. Would probably be better if users could customize their profile page as well.
Re:Show HN: My weekend project - Codestagram by johnnymonster on Wednesday January 02, 2013 @11:47AM (#4997530)
I don't think that some of the commenters here got that... lol
Re:Show HN: My weekend project - Codestagram by J_Darnley on Wednesday January 02, 2013 @12:13PM (#4997709)
When I saw this post I thought to myself "Code with colour filters applied?" When I clicked through it turns out it is just grey on grey so I can easily see why some wouldn't get it.
Re:Show HN: My weekend project - Codestagram by sturmeh on Wednesday January 02, 2013 @11:55AM (#4997579)
Awesome, but I can't delete my comments or posts. D:

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.

Re:Show HN: My weekend project - Codestagram by sundara on Wednesday January 02, 2013 @02:50PM (#4998804)
Nice Idea - I had developed http://www.Codeshelve.com sometime back - might want to check that out.
Re:Show HN: My weekend project - Codestagram by vojant on Wednesday January 02, 2013 @02:14PM (#4998568)
Really nice weekend project.

Only one column layout isn't the best idea for such site. Maybe 3 thumbnail in a row would be better?

Re:Show HN: My weekend project - Codestagram by intermeddle on Wednesday January 02, 2013 @03:05PM (#4998921)
This is similar to https://snipt.net
Re:Show HN: My weekend project - Codestagram by rmanyari on Wednesday January 02, 2013 @11:30AM (#4997438)
Really interesting idea, could become something big for the opensource community.
Re:Show HN: My weekend project - Codestagram by pablasso on Wednesday January 02, 2013 @03:31PM (#4999080)
I got the feeling that this got to the frontpage mostly because of the name.
Re:Show HN: My weekend project - Codestagram by cpdean on Wednesday January 02, 2013 @12:26PM (#4997789)
where are the cross-processing filters? Where's the vignette button?
Re:Show HN: My weekend project - Codestagram by shuzchen on Wednesday January 02, 2013 @06:25PM (#4999999)
This project is missing one major, necessary feature: direct submission from your IDE/editor of choice. Creating a write-enabled API is probably the first step towards that.
Re:Show HN: My weekend project - Codestagram by kordless on Wednesday January 02, 2013 @07:56PM (#5000417)
Or just use Github's.
Re:Show HN: My weekend project - Codestagram by smonte on Wednesday January 02, 2013 @04:42PM (#4999487)
I also had a similar weekend project, but specific to Java, http://javasnips.com/
Re:Show HN: My weekend project - Codestagram by thomasvendetta on Wednesday January 02, 2013 @10:44AM (#4997192)
Nice job Abe, keep up the good work!
Re:Show HN: My weekend project - Codestagram by bennyg on Wednesday January 02, 2013 @12:47PM (#4997944)
No Objective-C?