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
FROM ubuntu:latest | |
MAINTAINER Your Name <yourEmail@email.com> | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container. | |
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl curl lynx-cur |
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
// when the view is wired up using Storyboard and a custom xib, initWithCoder is called. | |
class MyViewController: UIViewController { | |
@IBOutlet var myView: MyView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
} |
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
require 'csv' | |
require 'json' | |
date = 5 | |
file_name = "weather-2014-12-#{date}" | |
body = File.open("/path/to/file/#{file_name}.csv", 'rb').read | |
csv = CSV.new(body, :headers => true, :header_converters => :symbol, :converters => :all) | |
weather = csv.to_a.map {|row| row.to_hash } | |
File.open("/path/to/file/#{file_name}.json", 'w') { |f| f.write(weather.to_json) } |
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
// usage | |
class MyViewController: UIViewController { | |
required init(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
setupTabBarItem("entries") | |
} | |
} | |
// where "entries" is the name of the image. | |
// should have 2 images named tabbar-entries and tabbar-entries-selected |
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
// | |
// MyViewController.swift | |
// | |
// Created by Nate Armstrong on 4/15/15. | |
// Copyright (c) 2015 Nate Armstrong. All rights reserved. | |
// | |
import UIKit | |
import CoreData |
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
DISPLAY=192.168.0.2:0 # replace `192.168.0.2` with the host machine's local ip |
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
// | |
// UIImage+Blurs.swift | |
// | |
// Created by Nate Armstrong on 12/2/15. | |
// Copyright © 2015 Nate Armstrong. All rights reserved. | |
// | |
// | |
// Compression uses RBResizer: https://gist.github.com/hcatlin/180e81cd961573e3c54d | |
import Foundation |
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
ai::Agent::Action * Chan::Program(const ai::Agent::Percept * percept) | |
{ | |
ai::CCheckers::Action *action = new ai::CCheckers::Action; | |
ai::CCheckers::MoveData move; | |
std::string board_str = percept->GetAtom("BASIC_BOARD").GetValue(); | |
ai::CCheckers::BasicBoard board(board_str); | |
int player = atoi(percept->GetAtom("PLAYER_NUMBER").GetValue().c_str()); |
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
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
var cell: UITableViewCell? | |
cell = tableView.dequeueReusableCellWithIdentifier(UITableViewCell.wta_reuseableIdentifier()) | |
if cell == nil { | |
cell = UITableViewCell(style: .Value1, reuseIdentifier: UITableViewCell.wta_reuseableIdentifier()) | |
} | |
if let result = viewModel?.results.value[indexPath.row] { |