(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// See commentary below this gist. | |
import Foundation | |
import QuartzCore | |
// Implementation from https://talk.objc.io/episodes/S01E90-concurrent-map | |
public final class ThreadSafe<A> { | |
var _value: A | |
let queue = DispatchQueue(label: "ThreadSafe") | |
init(_ value: A) { self._value = value } |
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
"Chuck this in [a vim runtime]/nerdtree_plugin/gitignore_filter.vim | |
if exists("loaded_nerdtree_gitignore_filter") | |
finish | |
endif | |
let loaded_nerdtree_gitignore_filter = 1 | |
call NERDTreeAddPathFilter('NERDTreeGitIgnoreFilter') |
+ (NSString *)timeIntervalToStringWithInterval:(NSTimeInterval)interval | |
{ | |
NSString *retVal = @"At time of event"; | |
if (interval == 0) return retVal; | |
int second = 1; | |
int minute = second*60; | |
int hour = minute*60; | |
int day = hour*24; | |
// interval can be before (negative) or after (positive) |
source ~/.bash_profile | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi |
Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.
The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca
import os | |
import ycm_core | |
flags = [ | |
'-resource-dir', | |
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0', | |
'-isysroot', | |
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk', | |
'-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include', | |
'-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks', |
For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.
A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s
include README.md | |
global-include *.html | |
global-include *.js | |
global-include *.css | |
global-include *.json | |
global-include *.txt | |
global-include *.sql |