This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
@ReactMethod | |
public void areNotificationsEnabled(Promise promise) { | |
try { | |
Boolean areEnabled = NotificationManagerCompat.from(getReactApplicationContext()).areNotificationsEnabled(); | |
promise.resolve(areEnabled); | |
}catch (Exception e) { | |
promise.reject(e); | |
} | |
} |
!#/bin/bash | |
git config --global commit.gpgsign false |
var http = require('http'); | |
var cluster = require('cluster'); | |
if (cluster.isMaster) { | |
var cpuCount = require('os').cpus().length; | |
for (var i = 0; i < cpuCount; i += 1) { | |
cluster.fork(); | |
} | |
} |
1 - Create a extensions for String
with a new, wonderfull, superpower method called crop
:
extension String {
func crop(from: Int, length: Int) -> String! {
let startIndex = self.index(self.startIndex, offsetBy: from)
var result = self.substring(from: startIndex)
let endIndex = result.index(result.startIndex, offsetBy: length)
result = result.substring(to: endIndex)
Extension:
import Foundation
import UIKit
extension UIColor {
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
func read(name: String) -> [String: Any] { | |
if let fileUrl = Bundle.main.url(forResource: name, withExtension: "plist"), | |
let data = try? Data(contentsOf: fileUrl) { | |
if let result = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] { | |
return result! | |
} | |
} | |
return [:] | |
} |
import Foundation | |
class UserDefaultsService { | |
static private var _instance: UserDefaultsService! = nil | |
static var sharedInstance: UserDefaultsService { | |
get { | |
if UserDefaultsService._instance == nil { | |
UserDefaultsService._instance = UserDefaultsService() | |
} |
import Foundation | |
class NotificationService { | |
static private var _instance: NotificationService! = nil | |
static var sharedInstance: NotificationService { | |
get { | |
if NotificationService._instance == nil { | |
NotificationService._instance = NotificationService() |
.card { | |
width: 230.551181102px; | |
height: 325.039370079px; | |
border: 5px solid #8B7355; | |
overflow: hidden; | |
float: left; | |
position: relative; | |
margin: 10px 10px; | |
background-image: url(img/parchment-bg.jpg); |