In your command-line run the following commands:
brew doctor
brew update
import { noop } from 'lodash'; | |
import EventEmitter from './EventEmitter'; | |
describe('EventEmitter class', () => { | |
describe('on()', () => { | |
it('subscribes to foo event with listener', () => { | |
const e = new EventEmitter(); | |
e.on('foo', noop); |
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
In your command-line run the following commands:
brew doctor
brew update
#I "../NeuralFish" | |
#load "NeuralFish_dev.fsx" | |
open NeuralFish.Types | |
open NeuralFish.Core | |
open NeuralFish.EvolutionChamber | |
open NeuralFish.Exporter | |
type SquareId = int |
import UIKit | |
// If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift | |
struct Person { | |
let name: String | |
let city: String | |
} | |
let people = [ |
function createMockVideoElement() { | |
"use strict"; | |
var video = {}; | |
video.__mock_listeners = {}; | |
video.__mock_progress = function(toProgress) { | |
var endProgressAt = video.currentTime + toProgress; | |
video.__mock_fire_event('play'); |
var text = ''; $('.col-email').each(function(index,el) { text = text + ($.trim($(el).text())+'\n' )}); var a = document.createElement("a"); var file = new Blob([text], {type: 'text/csv'}); a.href = URL.createObjectURL(file); a.download = name; a.click(); |
open System | |
open System.Collections.Concurrent | |
// Messages received by the throttling agent | |
type Message = | |
| Work | |
| Start of AsyncReplyChannel<unit> | |
| Pause | |
| Resume | |
| Quit |
/* | |
Copyright (c) 2011-present, NimbusKit. All rights reserved. | |
This source code is licensed under the BSD-style license found at http://nimbuskit.info/license | |
Extracted from NimbusKit: Swift Edition at https://github.com/nimbuskit/swift | |
*/ | |
extension NSNotificationCenter { | |
/** |
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
let calendar = NSCalendar.currentCalendar() | |
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
let now = NSDate() | |
let earliest = now.earlierDate(date) | |
let latest = (earliest == now) ? date : now | |
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
if (components.year >= 2) { | |
return "\(components.year) years ago" |