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
var express = require('express') | |
var bodyParser = require('body-parser') | |
var app = express() | |
// parse application/x-www-form-urlencoded | |
app.use(bodyParser.urlencoded({ extended: false })) | |
// parse application/json | |
app.use(bodyParser.json()) |
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
<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> |
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 Foundation | |
var input = readLine()! | |
let upperCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
var count = 1 | |
for letter in input.characters { | |
if upperCaseLetters.contains(String(letter)) { |
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 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 |
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 Foundation | |
extension String { | |
var sortedChars: String { | |
get { | |
var current = "" | |
self.sorted().forEach { | |
if $0 != " " { | |
current.append($0) |
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 Foundation | |
import UIKit | |
extension UIView { | |
var allSubviews: [UIView] { | |
get { | |
var viewsFound: [UIView] = [UIView]() | |
return viewsFound | |
} | |
} |
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 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) | |
} | |
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
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: |
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
#!/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" |
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
- (void)waitSignal | |
{ | |
while (dispatch_semaphore_wait(_internalSemaphore, DISPATCH_TIME_NOW)) | |
{ | |
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode | |
beforeDate:[NSDate dateWithTimeIntervalSinceNow:10]]; | |
} | |
} |
NewerOlder