This file contains hidden or 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 SwiftUI | |
//MARK:- Checkbox Field | |
struct CheckboxField: View { | |
let id: String | |
let label: String | |
let size: CGFloat | |
let color: Color | |
let textSize: Int | |
let callback: (String, Bool)->() |
This file contains hidden or 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
struct GradientText: View { | |
let title: String | |
let colors = Gradient(colors: [Color.hexStringToColor(hex: "#FF0000"), | |
Color.hexStringToColor(hex: "#40B482")]) | |
var body: some View { | |
RadialGradient(gradient: colors, | |
center: .center, | |
startRadius: 0, | |
endRadius: 300) |
This file contains hidden or 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
extension Color { | |
static func hexStringToColor (hex:String, opacity: Double = 1.0) -> Color { | |
var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() | |
if (cString.hasPrefix("#")) { | |
cString.remove(at: cString.startIndex) | |
} | |
if ((cString.count) != 6) { | |
return Color.gray | |
} | |
var rgbValue:UInt64 = 0 |
This file contains hidden or 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 SwiftUI | |
extension Color { | |
static func hexStringToColor (hex:String, opacity: Double = 1.0) -> Color { | |
var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() | |
if (cString.hasPrefix("#")) { | |
cString.remove(at: cString.startIndex) | |
} | |
if ((cString.count) != 6) { | |
return Color.gray |
This file contains hidden or 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
const char *sqlStatement = [query UTF8String]; | |
sqlite3_stmt *compiledStatement; | |
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { | |
// Loop through the results and add them to the feeds array | |
while(sqlite3_step(compiledStatement) == SQLITE_ROW) { | |
// Read the data from the result row | |
NSString *word = [NSString stringWithUTF8String:(char *)sqlite3_column_tcompiledStatement, | |
[arrayWords addObject:word]; | |
} | |
} |
This file contains hidden or 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
def parse_soup_to_simple_html(self): | |
news_list = self.__soup.find_all(['h1', 'h2']) # h1 | |
#print (news_list) | |
htmltext = ''' | |
<html> | |
<head><title>Simple News Link Scrapper</title></head> | |
<body> | |
{NEWS_LINKS} |
This file contains hidden or 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
func readDesc(_ desc:inout String) throws { | |
let newDesc = desc | |
defer { | |
desc = "" | |
} | |
throw SampleError.sample2(message: "cool error") | |
print(newDesc) | |
} | |
var desc = "Life is cool and play is a tool!" |