Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Katrina
    @katrinar
    sup
    Brian Correa
    @correa-brian
    hey
    lol
    haha
    tralala
    Katrina
    @katrinar
    brb
    omg
    Brian Correa
    @correa-brian
    grij
    code
    Katrina
    @katrinar
    var allGames = Array<MSGame>()
    Brian Correa
    @correa-brian
    This is the piece of code I'm working on
    Katrina
    @katrinar
    var = lol
    Brian Correa
    @correa-brian
    Also formatted code
    So cool
    Katrina
    @katrinar
    ' hello '
    what up ```
    get it
    
    
    `
    ```
    Brian Correa
    @correa-brian
            if(self.field.text?.characters.count == 0){
                let msg = "Please enter "+selectedField
                let alert = UIAlertController(title: "Missing Value", message: msg, preferredStyle: .Alert)
                alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil))
                self.presentViewController(alert, animated: true, completion: nil)
                return
            }
    Katrina
    @katrinar
    tks so much
    Brian Correa
    @correa-brian
    bk 2 work
    Brian Correa
    @correa-brian
    // including plugins
    
    var gulp = require('gulp'),
        gp_concat = require('gulp-concat'),
        gp_rename = require('gulp-rename'),
        gp_uglify = require('gulp-uglify'),
        to5 = require('gulp-6to5');
    
    gulp.task('es6-es5', function(){
        return gulp.src([
                    './public/app/ServerApp.js',
                    './public/app/*/**.js',
                    './public/app/*/*/**.js'
                ]
            )
            .pipe(to5())
            .pipe(gulp.dest('./public/build/es5/'));
    });
    
    gulp.task('build', function(){
        return gulp.src(
                [
                    './public/js/jquery.js',
                    './public/js/plugins.js',
                    './public/js/functions.js'
                ]
            )
            .pipe(gp_concat('gulp-concat.js'))
            .pipe(gulp.dest('./public/min/'))
            .pipe(gp_rename('vendor.min.js'))
            .pipe(gp_uglify())
            .pipe(gulp.dest('./public/build/'));
    });
    
    gulp.task('watch', function() {
        gulp.watch(['./public/app/ServerApp.js', './public/app/*/**.js', './public/app/*/*/**.js'], ['es6-es5']);
    });
    
    gulp.task('default', ['es6-es5', 'build', 'watch'], function(){});
    Katrina
    @katrinar
    tks bro
    Brian Correa
    @correa-brian
    what's trappening

    ISOMORPHIC

    ISO

    IS

    Katrina
    @katrinar
    SO
    MORPHIC
    Katrina
    @katrinar
    we need to get a bowl
    Brian Correa
    @correa-brian
    oh yeah
    salad bowl*
    for anyone reading this convo
    Katrina
    @katrinar
    hi
    Brian Correa
    @correa-brian
    is yours working
    Katrina
    @katrinar
    your leg?
    Brian Correa
    @correa-brian
    yeah
    Brian Correa
    @correa-brian
    did i miss a lot
    Katrina
    @katrinar
    no
    he checked if his code broke
    Katrina
    @katrinar
    ``
    ``
    //install cookie
    if (resource == 'profile'){
    req.session.user = result.id
    }
        res.json({
            confirmation: 'success',
            result: result
        }) ``

    ``

        if (resource == 'profile'){
            req.session.user = result.id
        }
    
        res.json({
            confirmation: 'success',
            result: result
        })

    ``

    Katrina
    @katrinar
    componentDidMount(){ api.handleGet('/account/currentuser', null, function(err, response){ if(err){ alert(err.message) return } console.log(JSON.stringify(response)) return }) }

    ``

    componentDidMount(){
        api.handleGet('/account/currentuser', null, function(err, response){
            if(err){
                alert(err.message)
                return
            }
            console.log(JSON.stringify(response))
            return
        })
    }

    ``

    Katrina
    @katrinar
    //
    //  CTCreatePlaceViewController.swift
    //  chat-ios
    //
    //  Created by Katrina Rodriguez on 6/14/16.
    //  Copyright © 2016 Kat. All rights reserved.
    //
    
    import UIKit
    
    class CTCreatePlaceViewController: CTViewController, UITextFieldDelegate, UIPickerViewDelegate, UIPickerViewDataSource {
    
        var textFields = Array<UITextField>()
        var statePicker: UIPickerView!
        var states =  [ "AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY" ]
    
        override func loadView() {
            let frame = UIScreen.mainScreen().bounds
            let view = UIView(frame: frame)
            view.backgroundColor = UIColor.lightGrayColor()
    
            let btnCancel = UIButton(type: .Custom)
            btnCancel.frame = CGRect(x: 20, y: 20, width: 100, height: 32)
            btnCancel.setTitle("Cancel", forState: .Normal)
            btnCancel.setTitleColor(.whiteColor(), forState: .Normal)
            btnCancel.addTarget(self,
                                action: #selector(CTCreatePlaceViewController.exit),
                                forControlEvents: .TouchUpInside)
            view.addSubview(btnCancel)
    
            let padding = CGFloat(20)
            let width = frame.size.width-2*padding
            let height = CGFloat(32)
            var y = CGFloat(120)
            let font = UIFont(name: "Heiti SC", size: 18)
    
            let fieldNames = ["Name", "Address", "City", "State", "Password"]
            for fieldName in fieldNames {
    
                let field = UITextField(frame: CGRect(x: padding, y: y, width: width, height: height))
                field.delegate = self
                field.placeholder = fieldName
                field.font = font
                field.autocorrectionType = .No
                let isPassword = (fieldName == "Password")
                field.secureTextEntry = (isPassword)
                field.returnKeyType = (isPassword) ? .Join : .Next
                let line = UIView(frame: CGRect(x: 0, y: height-1, width: width, height: 1))
                line.backgroundColor = .whiteColor()
                field.addSubview(line)
                view.addSubview(field)
                self.textFields.append(field)
                y += height+padding
            }
    
             self.statePicker = UIPickerView(frame: CGRect(x: 0, y: frame.size.height, width: frame.size.width, height: 160))
            self.statePicker.backgroundColor = .whiteColor()
            self.statePicker.delegate = self
            self.statePicker.dataSource = self
            view.addSubview(statePicker)
            self.view = view
        }
    
    
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            // Do any additional setup after loading the view.
        }
    
        //MARK: - PickerViewDelegate and Datasource
        func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
            return 1
        }
    
    
       func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
            return self.states.count
        }
    
    
        func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
            return self.states[row]
        }
    
        func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
            print("didSelectRow \(row)")
            for textField in self.textFields{
                if (textField.placeholder == "State"){
                    textField.text = self.states[row]
                    UIView.animateWithDuration(0.35,
                                               animations: {
                                                var frame = self.statePicker.frame
                                                frame.origin.y = self.view.frame.size.height
                                                self.statePicker.frame = frame
                        }, completion: nil)
    
                    let index = self.textFields.
    Katrina
    @katrinar
    render(){
            return (
                <section id="content">
                     <div className="section">
                        <div className="container clear-bottommargin clearfix">
                            <h4>{this.state.community.name}</h4>
                                <div className="list-group">
                                    <a href="#" className="list-group-item active">
                                        <h4 className="list-group-item-heading">List group item heading</h4>
                                        <p className="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
                                    </a>
                                    <a href="#" className="list-group-item">
                                        <h4 className="list-group-item-heading">List group item heading</h4>
                                        <p className="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
                                    </a>
                                    <a href="#" className="list-group-item">
                                        <h4 className="list-group-item-heading">List group item heading</h4>
                                        <p className="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
                                    </a>
                                </div>
                        </div>
                    </div>
                </section> 
            )
        }
    }
    Brian Correa
    @correa-brian
    //
    //  CTChatViewController.swift
    //  chat-ios
    //
    //  Created by Brian Correa on 6/16/16.
    //  Copyright © 2016 Velocity 360. All rights reserved.
    //
    
    import UIKit
    import Firebase
    
    class CTChatViewController: CTViewController, UITableViewDelegate, UITableViewDataSource {
    
        //Firebase Config:
        var firebase: FIRDatabaseReference! // establishes connection and maintains connection to DB
        var _refHandle: UInt!
    
        var place: CTPlace!
        var chatTable: UITableView!
    
        override func loadView(){
            let frame = UIScreen.mainScreen().bounds
            let view = UIView(frame: frame)
            view.backgroundColor = .grayColor()
    
            self.chatTable = UITableView(frame: frame, style: .Plain)
            self.chatTable.dataSource = self
            self.chatTable.delegate = self
            self.chatTable.registerClass(CTChatTableViewCell.classForCoder(), forCellReuseIdentifier: "cellId")
            view.addSubview(self.chatTable)
    
            self.view = view
        }
    
        override func viewDidLoad() {
            super.viewDidLoad()
            self.firebase = FIRDatabase.database().reference() // initialize FB manager
        }
    
        override func viewWillAppear(animated: Bool) {
            print("viewWillAppear:")
    
            //Listen for new messages in the FB DB
            self._refHandle = self.firebase.child(self.place.id).observeEventType(.Value, withBlock: { (snapshot) -> Void in
                print("SNAPSHOT -- \(snapshot)") // prints everything
            })
        }
    
        func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
            return 20
        }
    
        func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    
            let cell = tableView.dequeueReusableCellWithIdentifier(CTChatTableViewCell.cellId, forIndexPath: indexPath)
            cell.textLabel?.text = "\(indexPath.row)"
            return cell
    
        }
    
        func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
            print("didSelectRowAtIndexPath")
    
            //Push data to Firebase Database
            let post = ["from":"test", "message":"this is a test"]
            self.firebase.child(self.place.id).childByAutoId().setValue(post)
    
        }
    
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
    
        }
    
    }
    Katrina
    @katrinar
    let padding = CGFloat(6)
            let btnWidth = CGFloat(80)
            height = height-2*padding
    
            let cameraBtn = UIButton(type: .Custom)
            cameraBtn.frame = CGRect(x: padding, y: padding, width: height, height: height)
            cameraBtn.backgroundColor = .redColor()
            self.bottomView.addSubview(cameraBtn)
    
            self.messageField = UITextField(frame: CGRect(x: padding+40, y: padding, width: width-2*padding-btnWidth-40, height: height))
            self.messageField.borderStyle = .RoundedRect
            self.messageField.placeholder = "Post a message"
            self.messageField.delegate = self
            self.bottomView.addSubview(self.messageField)
    Katrina
    @katrinar
     func mapView(mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {
            self.selectedPlace = view.annotation as? CTPlace
    
            // user previously entered, do not enforce password again:
            if (self.selectedPlace?.visited == true){
                self.enterSelectedPlace()
                return
            }
    
            // user has to enter password
            if (CTViewController.currentUser.id == nil){
                self.showDarkOverlay()
                return
            }
    
                //user is an admin of place, do not need password
    
            let isAdmin = self.selectedPlace?.admins.contains(CTViewController.currentUser.id!)
    
    
            if (isAdmin == false){ //user has to enter password
                self.showDarkOverlay()
                return
            }
    
            // user is an admin of place, do not need password:
            let chatVc = CTChatViewController()
            chatVc.place = self.selectedPlace
            self.navigationController?.pushViewController(chatVc, animated: true)
    
        }