Skip to content

Instantly share code, notes, and snippets.

View ezefranca's full-sized avatar
💻
👨🏻‍💻

Ezequiel Santos ezefranca

💻
👨🏻‍💻
View GitHub Profile
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
@ezefranca
ezefranca / nokogiri.rb
Created January 28, 2022 21:29 — forked from mussatto/nokogiri.rb
testing nokogiri
require 'nokogiri'
html = '
<html>
<body>
<p>foo banana 1</p>
this text
<p>bar</p>
<p>foo banana 2</p>
<p>foo banana 3</p>
import UIKit
class FloatingButtonController: UIViewController {
private(set) var button: UIButton!
required init?(coder aDecoder: NSCoder) {
fatalError()
}
@ezefranca
ezefranca / ContentView.swift
Created March 29, 2021 16:35 — forked from takoikatakotako/ContentView.swift
SwiftUI delegate sample
import SwiftUI
struct ContentView: View, MyProtocol {
@State var text: String = "My Text"
var body: some View {
NavigationView {
VStack {
Text(text)
NavigationLink(destination: SecondView(delegate: self)) {
Text("2nd View")
@ezefranca
ezefranca / image-grid.md
Created April 14, 2020 20:28 — forked from trusktr/image-grid.md
Image grid in Markdown
screen shot 2017-08-07 at 12 18 15 pm blah screen shot 2017-08-07 at 12 18 15 pm screen shot 2017-08-07 at 12 18 15 pm
@ezefranca
ezefranca / unity-arduino-serial.md
Created March 24, 2020 23:59 — forked from tanyuan/unity-arduino-serial.md
Unity writes Arduino via serial port

Unity Writes Arduino via Serial Port

Tap 1 0 keys in Unity will make Arduino LED light on/off.

Arduino

const int ledPin = 13;
int ledState = 0;
@ezefranca
ezefranca / UIImage+PixelColor.swift
Created January 31, 2020 20:48 — forked from marchinram/UIImage+PixelColor.swift
iOS Swift UIImage subscript extension to get pixel color
import UIKit
extension UIImage {
subscript (x: Int, y: Int) -> UIColor? {
guard x >= 0 && x < Int(size.width) && y >= 0 && y < Int(size.height),
let cgImage = cgImage,
let provider = cgImage.dataProvider,
let providerData = provider.data,
let data = CFDataGetBytePtr(providerData) else {
return nil
import Foundation
extension Character {
var isEmoji: Bool {
return unicodeScalars.allSatisfy { $0.properties.isEmoji }
}
}
func recentlyUsedEmoji() -> [Character]? {
#if os(iOS)
@ezefranca
ezefranca / .swift
Created March 20, 2019 22:22 — forked from ramiresnas/.swift
SpriteSheet é uma classe que ajuda a trabalhar com sprites sheets de forma simplificada usando Swift.
//
// SpriteSheet.swift
// MyGame
//
// Created by Ramires Moreira on 14/03/19.
// Copyright © 2019 Ramires Moreira. All rights reserved.
//
import SpriteKit
@ezefranca
ezefranca / MKMapCameraAltitude
Created February 13, 2019 08:53 — forked from marmelroy/MKMapCameraAltitude
Calculating MKMapCamera's altitude for a distance
let altitude = distance*tan(M_PI*(75.0/180.0))