Skip to content

Instantly share code, notes, and snippets.

View charlesferreira's full-sized avatar

Charles Ferreira charlesferreira

View GitHub Profile
@charlesferreira
charlesferreira / index.html
Last active November 5, 2020 18:17
Minhas Listas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" />
<link rel="stylesheet" href="style.css" />
@charlesferreira
charlesferreira / app-context-annotation.xml
Last active April 3, 2019 16:57
Basic Spring's ApplicationContext XML configuration with annotation support
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="dev.charlesferreira.prospring5.ch3.annotation"/>
</beans>
@charlesferreira
charlesferreira / app-context-xml.xml
Created April 3, 2019 13:07
Basic Spring's ApplicationContext XML configuration file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
@charlesferreira
charlesferreira / AppDelegate.swift
Last active April 25, 2018 17:14
Watch connectivity example
import UIKit
import WatchConnectivity
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
WCSession.default.delegate = self
@charlesferreira
charlesferreira / Constants.swift
Created March 22, 2018 19:04
Exemplo de organização e uso de constantes
struct Constants {
struct UserDefaults {
static let keyForUID = "uid"
static let keyForOwnMessages = "ownMessages"
static let keyForAllMessages = "allMessages"
static let keyForNewMessages = "newMessages"
static let showNSFW = "showNSFW"
static let hideOwnMessages = "hideOwnMessages"
static let hideCollectedMessages = "hideCollectedMessages"
class MySingleton {
static func sharedInstance() -> MySingleton {
struct Static {
static let instance = MySingleton()
}
return Static.instance
}
private init() {}
@charlesferreira
charlesferreira / CustomView.swift
Last active February 23, 2018 18:15
Simple custom view delegate example
import UIKit
protocol CustomViewDelegate {
func customView(_ customView: CustomView, tappedButton button: UIButton)
}
class CustomView: UIView {
weak var delegate: CustomViewDelegate?