Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

William S Rodriguez willbuildapps

🏠
Working from home
View GitHub Profile
@willbuildapps
willbuildapps / gist:824ccad68984862c26cf8b54ca7666c7
Last active Sep 1, 2020
MacOs Sierra nom error "-bash : npm: command not found"
View gist:824ccad68984862c26cf8b54ca7666c7
sudo brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R username /usr/local
brew link --overwrite node
sudo brew postinstall node
View laziness.cs
public int Type
{
get
{
return Url switch
{
string tw when tw.Contains("twitter", StringComparison.InvariantCultureIgnoreCase) => 1,
string fb when fb.Contains("facebook", StringComparison.InvariantCultureIgnoreCase) => 2,
string gh when gh.Contains("github", StringComparison.InvariantCultureIgnoreCase) => 3,
string lk when lk.Contains("linkedin", StringComparison.InvariantCultureIgnoreCase) => 4,
@willbuildapps
willbuildapps / mac_high_sierra_py_dev.md
Created Jun 27, 2018
Mac OS High Sierra Python Dev Environment Setup
View mac_high_sierra_py_dev.md

Install iTerm2

Download and install https://www.iterm2.com/

Install the Xcode Command Line Tools directly from the command line

xcode-select --install

Install Hombrew

View AndroidXPackage_References.xml
<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.Migration">
<Version>1.0.0-preview02</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Common">
<Version>2.0.1-preview02</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Runtime">
<Version>2.0.1-preview02</Version>
</PackageReference>
View sample.cs
//...
var currentContext = Android.App.Application.Context;
var receiver = new BluetoothDeviceDiscoverReceiver(currentContext);
var filter = new IntentFilter(BluetoothDevice.ActionFound);
filter.AddAction(BluetoothAdapter.ActionDiscoveryStarted);
filter.AddAction(BluetoothAdapter.ActionDiscoveryFinished);
currentContext.RegisterReceiver(receiver, filter);
View MainView.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:behaviors="clr-namespace:AwesomeSeries.Behaviors;assembly=AwesomeSeries"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AwesomeSeries.Views.MainView">
<ContentPage.Content>
<ListView
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
HasUnevenRows="True"
View AttachedItemTappedBehavior.cs
public static class AttachedItemTappedBehavior
{
public static readonly BindableProperty CommandProperty =
BindableProperty.CreateAttached(
propertyName: "Command",
returnType: typeof(ICommand),
declaringType: typeof(ListView),
defaultValue: null,
defaultBindingMode: BindingMode.OneWay,
validateValue: null,
View AppSettings
public const string ApiUrl = "https://api.themoviedb.org/3";
public const string ApiKey = "ad332258020257fb88e2cc468225dcb0";
public const string ApiImageBaseUrl = "https://image.tmdb.org/t/p/w500/";
View HttpLoggingHandler.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace AwesomeSeries.Infra.HttpTools
View Serie.cs
using System;
using Newtonsoft.Json;
namespace AwesomeSeries.Models
{
public class Serie
{
[JsonProperty("original_name")]
public string OriginalName { get; set; }