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
const fetch = require("isomorphic-fetch") | |
const endpoint = `https://talaikis.com/api/quotes/random/` | |
function* createGetQuote(){ | |
const resp = yield fetch(endpoint) | |
const quote = yield resp.json() | |
return `${quote.quote}--${quote.author}` | |
} | |
const getQuote = createGetQuote() |
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
## Install MongoDB on macOS Sierra | |
This procedure explains how to install [MongoDB](https://www.mongodb.org) using [Homebrew](http://brew.sh) on macOS Sierra 10.12. | |
Official MongoDB install documentation: [here](https://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/) | |
### Install Homebrew | |
* Installing Homebrew is effortless, open Terminal and enter : | |
`$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` |
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
module.exports = { | |
parser: "babel-eslint", | |
env: { | |
browser: true, | |
commonjs: true, | |
es6: true, | |
node: true, | |
jest: true, | |
}, |
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
/* | |
@arr: array of 0s and 1s | |
@returns: an array of indexes | |
*/ | |
const findIndexes = arr => { | |
return arr.reduce((m, e, i) => { | |
e && m.push(i) | |
return m | |
}, []) | |
} |
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
extension UIColor { | |
convenience init(hex: Int, alpha: CGFloat = 1.0) { | |
let r = CGFloat((hex >> 16) & 0xff) / 255 | |
let g = CGFloat((hex >> 08) & 0xff) / 255 | |
let b = CGFloat((hex >> 00) & 0xff) / 255 | |
self.init(red: r, green: g, blue: b, alpha: alpha) | |
} } | |
// usage |
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 UIKit | |
extension UIView { | |
// top bottom left and right | |
func anchorEdges(top: NSLayoutYAxisAnchor?, tConst: CGFloat = 0, | |
left: NSLayoutXAxisAnchor?, lConst: CGFloat = 0 , | |
right: NSLayoutXAxisAnchor?, rConst: CGFloat = 0 , | |
bottom: NSLayoutYAxisAnchor?, bConst: CGFloat = 0 | |
) -> (NSLayoutConstraint?, NSLayoutConstraint?, NSLayoutConstraint?, NSLayoutConstraint?) { |
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
Feb 6 16:13:29 192 Memory Purge[4693]: [error] Connection failed. Server error., not found | |
Feb 6 16:13:29 192 Memory Purge[4693]: [info] Status was: 404 | |
Feb 6 16:13:29 192 Memory Purge[4693]: [info] ATAPIRequest failed: Server error., not found | |
Feb 6 16:13:45 192 com.apple.xpc.launchd[1] (com.apple.WindowServer[4368]): Service exited due to signal: Segmentation fault: 11 sent by exc handler[0] | |
Feb 6 16:13:46 192 sessionlogoutd[13366]: DEAD_PROCESS: 4367 console | |
Feb 6 16:13:46 192 com.apple.xpc.launchd[1] (com.apple.auditd[13367]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.auditd | |
Feb 6 16:13:46 192 aeid[13372]: audit warning: soft /var/audit | |
Feb 6 16:13:46 192 aeid[13371]: audit warning: allsoft | |
Feb 6 16:13:46 192 aeid[13374]: audit warning: closefile /var/audit/20180206130416.20180206131346 | |
Feb 6 16:13:48 ahmeds-mbp findmydeviced[13376]: objc[13376]: Class LocalizedUnregisterErrorKey is implemented in both /System/Library/Priv |
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
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.user.loginwindow.13375.4294967295): com.apple.AssistiveControl (lint): The HideUntilCheckIn property is an architectural performance issue. Please transition away from it. | |
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] (com.apple.coreservices.useractivityd): Unknown key for Boolean: DrainMessagesAfterFailedInit | |
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] (com.apple.coreservices.UASharedPasteboardProgressUI): Unknown key for Boolean: DrainMessagesAfterFailedInit | |
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.user.loginwindow.13375.4294967295): com.apple.DwellControl (lint): The HideUntilCheckIn property is an architectural performance issue. Please transition away from it. | |
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] (com.apple.imklaunchagent): This service is defined to be constantly running and is inherently inefficient. | |
Feb 6 16:14:09 ahmeds-mbp com.apple.xpc.launchd[1] ( |
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 UIKit | |
class Second: UIViewController { | |
@IBOutlet weak var trigger: RoundButton! | |
@IBOutlet weak var right: RoundButton! | |
@IBOutlet weak var left: RoundButton! | |
@IBOutlet weak var top: RoundButton! | |
var clicked = false | |
var rightCenter: CGPoint! |
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 numbers | |
def numOrString(list): | |
cache = [] | |
strings = [] | |
nums = [] | |
for n in list: | |
if(isinstance(n, numbers.Number)): | |
pass | |
cache.append(1) |