(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.
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
// Use an integer literal to instantiate | |
let a: BigInt = 23559821412349283 | |
// Or use a string literal if you want to start with a number that is greater than IntMax | |
let b: BigInt = "123456789876543234567876543234567876543" | |
// Perform arithmetic operations | |
let c: BigInt = 123456 + 321 // -> 12777 | |
let d = c / 100 // -> 127 | |
let e = d << d // -> 12700000000......(127 zeros) |
As of BBEdit 13.1, the HTML Tidy built-ins are back and you should use those instead. This gist is so old it refers to "OS X", c’mon!
If for some reason you are using this, note @ryanfrancesconi’s comment about the correct place to put the file when using sandboxed versions of BBEdit.
#!/bin/bash | |
# | |
# Use agvtool to set Xcode project build number and create git tag | |
# Note: requires Xcode project configured to use Apple Generic Versioning and git | |
# | |
# Usage: set_agv_ver.sh 123 | |
# | |
# src: https://gist.github.com/rob-murray/8644974 | |
# |
In early November, 2012, Apple issued a graphics update for all mid-2012 MacBooks. In a continued streak of stupidity, however, this update forces your Mac to use "Safe Sleep". This means that the entire contents of your RAM is written to your disk every time you put your Mac to sleep. | |
This is retarded on the scale of the Titanic's navigational plan for two reasons: | |
1) Your Mac likely has 8 or 16GB of RAM. This is a ton of wasted disk space; especially on MacBook Airs that ship with only 256GB SSDs to begin with. | |
2) SSDs wear out as you write to them. Each cell of a SSD can only be written to a certain number of times before it becomes read-only. If you put your computer to sleep many times a day, OS X is slowly but surely destroying your SSD with unneeded write cycles. | |
Worst of all, the graphics update makes it IMPOSSIBLE to turn off safe sleep using the standard approach you'll find on Google: |
import Foundation | |
import CoreMotion | |
// Warning: This class assumes no one else is currently using the CMMotionManager. | |
class DeviceRaisedToEarListener: NSObject { | |
private let deviceQueue = NSOperationQueue() | |
private let motionManager = CMMotionManager() | |
private var vertical: Bool = false | |
private(set) var isRaisedToEar: Bool = false { |
#import <UIKit/UIKit.h> | |
@interface UICollectionView (ReloadItemsAnimated) | |
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated; | |
@end |
// | |
// Copyright Noel Cower 2014. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
// | |
import Foundation | |
/// Asynchronous WorkQueue scheduling operator. |