Skip to content

Instantly share code, notes, and snippets.

View madson's full-sized avatar
👨‍💻
Always coding

Madson Mac madson

👨‍💻
Always coding
View GitHub Profile
Como parte do processo seletivo do Elo7, gostaríamos que você fizesse uma
pequena tarefa. Conforme seu resultado daremos continuidade ao processo te
convidando para uma sessão de pair-programming.
Durante o desenvolvimento dê preferência para implementação em Android ou iOS.
O objetivo dessa tarefa é avaliar como você vai desenvolver o código em termos
de estilo, eficiência e qualidade.
Crie um projeto no seu Github para que vejamos os passos feitos através dos
- (void)waitSignal
{
while (dispatch_semaphore_wait(_internalSemaphore, DISPATCH_TIME_NOW))
{
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
beforeDate:[NSDate dateWithTimeIntervalSinceNow:10]];
}
}
@madson
madson / add_launchd_to_tcc.sh
Last active August 29, 2015 14:26 — forked from mtauraso/add_launchd_to_tcc.sh
TCC Database Script
#!/bin/bash
# This will add lauchd to the list of allowed processes for accessibility access
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/sbin/osascript',1,1,1,NULL)"
# This outputs the rows in the TCC database
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db 'select * from access'
echo "Restart is required for these changes to take effect"
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
line_length: 120
disabled_rules:
- trailing_whitespace
force_cast: warning
force_try:
severity: warning
type_name:
@madson
madson / ProgressBubble.swift
Created December 16, 2016 17:56
UIView with a rounded progress border
class ProgressBubble : UIView {
var startAngle: Double = 90
var lineWidth: CGFloat = 4
var timer: Timer!
var borderColor: UIColor = UIColor(colorLiteralRed: 248/255.0, green: 141/255.0, blue: 2/255.0, alpha: 1)
override func draw(_ rect: CGRect) {
self.drawBorder(rect, self.startAngle, self.borderColor)
}
import Foundation
import UIKit
extension UIView {
var allSubviews: [UIView] {
get {
var viewsFound: [UIView] = [UIView]()
return viewsFound
}
}
import Foundation
extension String {
var sortedChars: String {
get {
var current = ""
self.sorted().forEach {
if $0 != " " {
current.append($0)
import Foundation
var text = "baabc"
func removeDuplicatedCharacters(in text: String) -> String {
var other = text
var uniqueChars = [String]()
for char in other.characters {
let current = char.description
import Foundation
var input = readLine()!
let upperCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var count = 1
for letter in input.characters {
if upperCaseLetters.contains(String(letter)) {
@madson
madson / draw grid.html
Created October 8, 2019 00:40
Draw grid using canvas
<html>
<head>
<style>
* { margin: 0px; padding: 0px; }
#imgGrid { position: absolute; top: 0; left: 0; z-index: 0; opacity: 1; }
#myCanva { position: absolute; top: 0; left: 0; z-index: 999; opacity: 0.5; }
img { object-fit: contain; width: 1000px; height: auto; }
</style>
</head>
<body>