Skip to content

Instantly share code, notes, and snippets.

Juan M Gómez jmgomez

Block or report user

Report or block jmgomez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TheMoviewDB.fs
module TheMovieDB =
open Model
let key = "YOUR_KEY"
let baseUrl = "http://api.themoviedb.org/3"
let baseImageUrl = "https://image.tmdb.org/t/p/w185/"
let [<Literal>] discoverUrl = """{ "page": 1, "results": [{ "adult": false, "backdrop_path": "/dkMD5qlogeRMiEixC4YNPUvax2T.jpg", "genre_ids": [28,12,878, 53 ],"id": 135397,"original_language": "en", "original_title": "Jurassic World", "overview":"overviewremoved", "release_date": "2015-06-12", "poster_path": "/uXZYawqUsChGSj54wcuBtEdUJbh.jpg","popularity": 88.551849, "title": "Jurassic World", "video": false,"vote_average": 7.1, "vote_count": 435 }],"total_pages": 11543, "total_results": 230847}"""
type MovieList = JsonProvider<discoverUrl>
let getMoviesByPage page = async {
let! response =
View AdventCalendarAppDelegate.fs
[<Register ("AppDelegate")>]
type AppDelegate () =
inherit UIApplicationDelegate ()
override val Window = null with get, set
// This method is invoked when the application is ready to run.
override this.FinishedLaunching (app, options) =
Xamarin.Forms.Forms.Init();
View AdventCalendarView.fs
module View =
type MoviePage (movie:Model.Movie) as this =
inherit ContentPage()
do
let title = Label(Text = movie.Title, FontSize = 18., FontAttributes = FontAttributes.Bold, TextColor = Color.Accent)
this.Title <- movie.Title
let img = Image(Source=ImageSource.FromUri(Uri(movie.ImagePath)))
let overview = Label(Text = movie.Overview)
let layout = RelativeLayout()
View AdventCalendarTheMovieDV.fs
module TheMovieDB =
open Model
let key = "YOUR_KEY"
let baseUrl = "http://api.themoviedb.org/3"
let baseImageUrl = "https://image.tmdb.org/t/p/w185/"
let [<Literal>] discoverUrl = """{ "page": 1, "results": [{ "adult": false, "backdrop_path": "/dkMD5qlogeRMiEixC4YNPUvax2T.jpg", "genre_ids": [28,12,878, 53 ],"id": 135397,"original_language": "en", "original_title": "Jurassic World", "overview":"overviewremoved", "release_date": "2015-06-12", "poster_path": "/uXZYawqUsChGSj54wcuBtEdUJbh.jpg","popularity": 88.551849, "title": "Jurassic World", "video": false,"vote_average": 7.1, "vote_count": 435 }],"total_pages": 11543, "total_results": 230847}"""
type MovieList = JsonProvider<discoverUrl>
let getMoviesByPage page = async {
let! response =
View AdventCalendarModel.fs
module Model =
type Movie () =
member val Title = "" with get, set
member val ImagePath = "" with get, set
member val Overview = "" with get, set
View HelloCocosSharp
namespace HelloCocos
open System
open MonoTouch.UIKit
open MonoTouch.Foundation
open CocosSharp
type HelloScene () =
inherit CCLayerColor()
do
View blog-creando-un-typeprovider
namespace TypeProvidersGeeksMs
open System
open System.Reflection
open ProviderImplementation.ProvidedTypes
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Quotations
View gist:8476420
type MapRecord() =
let value = 0.2
abstract Latitude : double with get, set
default this.Latitude with get() = value and set(v) = ignore()
abstract Longitude : double with get, set
default this.Longitude with get() = 5.0 and set(v) = ignore()
type MapRecord2() =
@jmgomez
jmgomez / gist:6779191
Last active Dec 24, 2015
A simple download manager to download files via http. Feature to show percentage and resume downloads.
View gist:6779191
public interface IDownloadManager {
event DownloadManager.PercentageChangedDelegate OnPercentageChanged;
event DownloadManager.DownloadErrorDelegate OnDownloadError;
event DownloadManager.DownloadCompleteDelegate OnDownloadComplete;
Task DownloadFileAsync(string url, string localPath);
void AbortDownload();
bool IsTheSameFile(string expectedMD5, string filePath);
double Percentage { get; }
}
public class DownloadManager : IDownloadManager {
You can’t perform that action at this time.