This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Required to register for notifications | |
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings | |
{ | |
[RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings]; | |
} | |
// Required for the register event. | |
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken | |
{ | |
[RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Internals; | |
using Xamarin.Forms.Xaml; | |
namespace Playground.Helpers | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Xaml; | |
namespace Playground.Helpers | |
{ | |
[ContentProperty(nameof(Value))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>bindprop</Title> | |
<Shortcut>bindprop</Shortcut> | |
<Description>Code snippet for Creating a Bindable Property</Description> | |
<Author>Lucas Viana</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ASP.NET Framework | |
modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>(); | |
// ASP.NET Core | |
foreach (var entityType in modelBuilder.Model.GetEntityTypes()) | |
{ | |
foreach (var navigation in entityType.GetNavigations()) | |
{ | |
navigation.ForeignKey.DeleteBehavior = DeleteBehavior.Restrict; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller { | |
public IActionResult Put(Model posted) { | |
foreach (var item in fromDb.Collection) | |
{ | |
var editedItem = posted.Collection.FirstOrDefault(a => item.Id == a.Id); | |
if(editedItem is null) | |
Db.Remove(item); | |
else | |
Db.Entry(item).CurrentValues.SetValues(editedItem); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MemorySpace { | |
public: | |
void setSecond(long long second) { | |
this->second_1 = second & 0x00000000ffffffff; | |
this->second_2 = (second & 0xffffffff00000000) >> 32; | |
} | |
long long getSecond() { | |
return this->second_1 + (((unsigned long long )this->second_2) << 32); | |
} | |
private: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
// Importing all components inside './components' folder | |
const req = require.context('./components/', true, /\.(js|vue)$/i); | |
req.keys().map(key => { | |
const fileNameKey = key.substr(key.lastIndexOf('/') + 1); | |
const name = fileNameKey.match(/\w+/)[0]; | |
return Vue.component(name, req(key).default) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Copy(this Object destiny, Object origin, IEnumerable<string> fieldsToIgnore) | |
{ | |
fieldsToIgnore = fieldsToIgnore.ToArray(); | |
// | |
var typeDestiny = destiny.GetType(); | |
var propsDestiny = typeDestiny.GetProperties(); | |
var typeOrigin = origin.GetType(); | |
var propsOrigin = typeOrigin.GetProperties(); | |
foreach (var prop in propsDestiny) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package intro.api.senai.com.apiusage.utils; | |
import intro.api.senai.com.apiusage.models.CEP; | |
import retrofit2.Call; | |
import retrofit2.http.GET; | |
import retrofit2.http.Path; | |
public interface CEPRestService { | |
@GET("{cep}") |