Skip to content

Instantly share code, notes, and snippets.

View geek1706's full-sized avatar
🏠
Working from home

Trung Nguyen geek1706

🏠
Working from home
View GitHub Profile
@geek1706
geek1706 / om.json
Last active November 19, 2019 15:30
na
{
"e+y+s+m": false,
"s+f+a": 4,
"a+u+h+r": true,
"f+a": true
}
{
"adsUserHasRated": false,
"downloadsPerAd": 2,
"playsPerAd": 2,
"downloadsForPrompt": 2,
"playsForAds": 2,
"downloadsForAds": 2,
"adsBackground": false
}
{
"adsOnSearchScreen": true,
"adsOnMusicDetail": false,
"adsOnLaunch": true,
"adsOnFinishingDownload": false,
"adsOnPlayerScreen": false,
"adsOnSetting": false,
"adsOnMyLibrary": false,
"adsOnPlaylist": false,
"adsOnHome": false,
{
"adsOnSearchScreen": true,
"adsOnMusicDetail": true,
"adsOnLaunch": false,
"adsOnFinishingDownload": false,
"adsOnPlayerScreen": false,
"adsOnSetting": false,
"adsOnMyLibrary": false,
"adsOnPlaylist": false,
"adsOnHome": false,
@geek1706
geek1706 / music-offline.json
Last active July 24, 2019 09:54
Music offline config
{
"enableDropbox": true,
"enableGoogleDrive": false,
"supportedAudioFiles": [
"mp3",
"wav"
],
"supportedVideoFiles" : [
"mov",
"mp4"
{
"qft": "+filterui:photo-photo+filterui:imagesize-wallpaper+filterui:aspect-tall",
"query": "wallpaper",
"adType": "rewardedVideo",
"showAds": false,
"canSearch": false
}
[
{
"name": "All",
"image": ""
},
{
"name": "BTS",
"image": "https://wallpaperaccess.com/full/8337.jpg"
},
{
@geek1706
geek1706 / RomanNumerals.swift
Last active April 23, 2019 03:04 — forked from kumo/RomanNumerals.swift
A simple roman numerals converter in Swift
import Foundation
func toRoman(number: Int) -> String {
guard number < 1000 else { fatalError("Number must be less than 1000") }
let romanValues = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
let arabicValues = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
var romanValue = ""
import UIKit
final class LinearGradientLayer: CALayer {
enum Direction {
case vertical
case horizontal
case custom(start: CGPoint, end: CGPoint)
var points: (start: CGPoint, end: CGPoint) {
switch self {
case .vertical:
return (CGPoint(x: 0.5, y: 0.0), CGPoint(x: 0.5, y: 1.0))
func setRequired() {
guard var labelText = self.text else { return }
if labelText.range(of: "*") == nil {
labelText = labelText + "*"
}
let range = (labelText as NSString).range(of: "*")
let attributedString = NSMutableAttributedString(string: labelText)
attributedString.addAttributes([.foregroundColor: UIColor.red], range: range)