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
<dependencies> | |
<!-- Apache Commons: DBCP https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 --> | |
<dependency> | |
<groupId>org.apache.commons</groupId> | |
<artifactId>commons-dbcp2</artifactId> | |
<version>2.1.1</version> | |
</dependency> | |
<!-- Jackson : Databind https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> | |
<dependency> |
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 android.os.AsyncTask; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; |
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.retrofit.config; | |
import intro.api.senai.com.apiusage.utils.AppUtils; | |
import intro.api.senai.com.apiusage.utils.CEPRestService; | |
import retrofit2.Retrofit; | |
import retrofit2.converter.jackson.JacksonConverterFactory; | |
public class RetrofitConfig { | |
private Retrofit retrofit; |
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}") |
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
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
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
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
// 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
<?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> |
OlderNewer