fssnippets / fssnip-website Goto Github PK
View Code? Open in Web Editor NEWSource code for the F# Snippets web site
Home Page: http://fssnip.net
Source code for the F# Snippets web site
Home Page: http://fssnip.net
Listing of snippets per tag sometimes displays items twice. On my machine:
I guess this might also be DotLiquid issue... (Related to #17)
There is a lot of different tags, so navigating through them is not very easy. It would be nice to have some automatic clustering of tags that makes it possible to group snippets in just a few categories (these could be even manually named).
Repro steps:
Do you alredy have a nice sample where you use options in the template engine?
/cc @tforkmann
In showSnippet
and showRawSnippet
, we should check that the snippet exists. If it does not exist, we should report a nice error.
Hello,
When clicking copy source for the following [http://fssnip.azurewebsites.net/U] , the resulting copy source dialog is missing content from line 6 , .
If I do the same with raw view the code is shown correctly.
Regards Michael
When you click on the "View all..." links at the bottom of the home page, you get an error...
For very long lines, we need to have a scroll-bar. For example: http://fssnip.net/rZ
... when inserting a new version of a snippet. Currently, we just overwrite the old ones.
... are not implemented! They should copy the thing into clipboard (if we can do that without ugly hacks - if no, we should remove the buttons)
Usually humans are searching case-insensitive style, e.g. if I search for Fibonacci sequence I actually don't care if the solution is named as the Fibonacci (correctly upper case, named after the mathematician), or is it so common term in information technology, like internet, that it could be written in lower case.
This is effecting three places:
My suggestion would be converting all the tags in lower case, just to break the FXCop rule #CA1308
On http://www.fssnip.net/q/title/Hello-world-F, click Load in tsunami.io
Gives
This site can’t be reached
tsunami.io’s server IP address could not be found.
Edge browser enter "process" hit enter
nothing...
I know there are three options given. But it will be great if we can give execution of code on same page. Dotnetfiddle is doing it. And I have used them in my blog. It will be great for user if s/he can see what code is doing on page. And also edit it before copying it.
Just and idea. Please provide your thoughts on that.
The page currently displays only the latest version of a snippet. For some snippets, there are multiple versions of the same snippet. We should always display the latest one and we need to add buttons for navigating to the next/previous snippet.
(See also the functions loadSnippet
and loadRawSnippet
, which currently always load file named 0
, which stands for the first version.)
JQuery that is used is pretty old. And we are using local copy. It will optimize performance of web page quite a lot.
If we can use Google cdn JQuery (fallback will be local one.)
And move scripts on bottom. That will not block page loading.
Let me know what you think on this.
Looks like we are now getting some malicious edits for the first time: http://fssnip.net/P
We need to do something against this - probably keep history of metadata #37 and add a way to revert changes (perhaps based on Captcha-protected voting, or something like that).
What is the database story?
Currently we need to download a zip to get started. How is this working in production?
Currently, we ignore the NuGet references specified when inserting a snippet.
To implement this, we can use Paket's public api to download the package, extract the files etc. Then we can pass the references as additional parameter when calling Literate.ParseScriptString
.
Currently, the data is stored in local file system. This needs to be changed to use Azure blob storage instead (or even better, there should be some way to switch between local for development and Azure for testing & production).
This should increment the number of likes for the snippet and save the index.json
file. This should be done with a bit of JavaScript without refreshing the whole page.
Currently, the input page has no input validation. Here is a list of things we need to add
Check that nothing is missing for public snippets and that basic things are provided for non-hidden snippet
Can we check the same rules in the Bootstrap form?
It would be nice to format the snippet in the background and send it back as a preview.
Something has gone wrong.
Type annotations are always visible after the code.
Looks very messy.
When the cursor is over JsonProvider
on the page http://fssnip.azurewebsites.net/rE
The current design is rough copy of the original style with a few changes (I mainly did whatever I could to put something quickly together). It would be nice to redesign the web page and make it nicer.
There have been several times when I wanted to use some code that has been posted on fssnip.net, but I can't see any license terms for the snippets. And in the absence of any posted license terms, the license terms are the default under copyright law: "All rights reserved". Which doesn't give me permission to use the code under any circumstances.
Now, I believe that the intent of the people posting these snippets was to allow them to be reused. But unless the snippet is truly trivial -- on the order of let add x y = x + y
-- I have to assume that default copyright law applies, and I can't use the snippets.
I think it would be a good idea to add a section to the "Insert new snippet" form where a license can be chosen -- defaulting to the most-used license, MIT, and including several of the most popular licenses in the list. And it would be great if the "owner" of any given snippet could retroactively add a license to their snippet, so that people who (like me) are trying to be scrupulous about respecting licensing terms can finally use those useful snippets as they were intended to be used.
Related to #7 - we also need to implement insert snippet!
When inserting a new version of a password protected snippet, we should check the password first.
Hi there - I consider implementing the tooltip engine into Gitea - is this an own implementation?
How do you recommend to implement the whole stuff, so including syntax highlighting?
enter process in search
http://fssnip.net/sw should be among the results
In general improved searching would benefit the community. Sadly I don't have time to work on this any time soon. Can this become an up-for-grabs issue?
This is kind of strange. A snippet of mine has disappeared. Earlier it was here:
http://fssnip.net/8qR
Now I get messages "Snippet not found" and "The snippet '8qR' that you were looking for was not found." at the 8qR-address.
Currently at: http://fssnip.net/pages/Rss
F# Snippets would be a great project to use as a case study for running Suave web applications on Core CLR. It is a fairly straightforward web application that runs nicely on Azure Web Sites currently and uses Azure Storage, but it would be nice to see what a typical Suave web site would need for running smoothly on CoreCLR in a cross-platform environment (say, CoreCLR inside Docker in Azure, still using Azure storage...).
@KevinRansom & community already did some work on porting Suave to run on CoreCLR, so let's open an issue here for this and see what else will be needed!
Once we have CoreCLR version of F# compiler and Suave, the next thing will be integrating it with the new DotNet command line tools so that you can clone the repo and get started with just:
dotnet restore
dotnet run
Thanks to @kunjee17's PR, we now have a neat script that minimizes JS files using some node.js tooling. This involves having Node.js
and Npm.js
dependencies and then (post-restore, pre-run) invoking them. It looks like DNX had postrestore scripts, which would let us do this nicely, but I'm not sure what is the status - there is a cli
issue for this: https://github.com/dotnet/cli/issues/237, but without much information.
@KevinRansom @NumberByColors Do you know if postrestore scripts will be ported to the new dotnet
command? Looks like they would be pretty useful for things like running Node as part of your Suave app!
@tpetricek when are you going to deploy the latest version? seems the current live one is still asp.net MVC?
I regularly find snippets via google, but then get linked to the old site that is broken in Firefox. Is the new site still waiting on some feature before being marked ready? Or maybe a link on snippets on the old site could take you to the same thing on the new site?
See #35
Currently Google doesn't find fssnip.net snippets well.
I think this would be easy to improve:
When you click on the tag name or author name at the bottom of the home page, you get an error...
The current web site has minimal API that is used by a few services (Try F# and Fun 3D). This needs to be added too.
Here are the things we need:
As demonstrated in fsprojects/FSharp.Formatting#405, there can be ugly "flickering" of the tooltip when it overlaps its parent element. On the FsSnippets site, that overlap is only by a single pixel, just as it is in the second animated-GIF example in that bug report. (The one from the FSharp.Formatting site). However, I can reproduce that same flickering-tooltip ugliness on the FsSnippets site by moving my mouse cursor horizontally left and right along the bottom pixel of any F# identifier. The solution is quite simple: add pointer-events: none
to the .tip
CSS. (See the fsprojects/FSharp.Formatting#405 report for more discussion of the technical details).
We do not currently have any tests, but a good first step would be to add CI that builds the site and starts the server to make sure that it compiles..
On my machine in Firefox, a snippet's code is squeezed into a tiny narrow column.
I can fix this by removing overflow:hidden on .snippet, though maybe that needs to be there for some other reason.
I was going to submit a PR, but whilst the website loads a css file called site.css I cannot find it in the github repo.
The Build.findPort function in build.fsx is not compatible with Mono.
Error-Message:
System.NotImplementedException: The method or operation is not implemented.
at System.Net.NetworkInformation.UnixIPGlobalProperties.GetActiveTcpListeners () <0x921c020 + 0x0001f> in :0
at FSI_0001.Build.findPort (Int32 port) <0x921be50 + 0x0001f> in :0
at <StartupCode$FSI_0001>.$FSI_0001_Build$fsx.main@ () <0x921b268 + 0x002e3> in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x1a55c40 + 0x000a1> in :0
Stopped due to error
We need some search - even a basic one would be nice!
That said, there are fun things we could do - like search identifiers, search in type names, search in comments etc.
Under what circumstances does a posted snippet get tweeted by the website? Sometimes I ssubmit a snippet and see a tweet but sometimes no tweet, is this a bug or are there certain conditions that must be met?
The current implementation contains a nasty workaround in app.fsx
. This should use the standard Suave combinator, but sadly, that was failing on Azure for me in earlier project. See the discussion here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.