Skip to content

Instantly share code, notes, and snippets.

View kennylugo's full-sized avatar
🎯
Focusing

Kenny Lugo kennylugo

🎯
Focusing
View GitHub Profile
@kennylugo
kennylugo / crawl.js
Last active December 29, 2015 23:12
Basic Site Crawling
var request = require("request"); //We are asking to include these npm modules in our project.
var cheerio = require("cheerio");
// request('https://news.ycombinator.com', function (error, response, html) {
// if (!error && response.statusCode == 200){
// console.log(html);
// }
// });
@kennylugo
kennylugo / makeStatusBarWhite.swift
Last active December 28, 2015 18:42
Make status bar white in iOS 9 with Swift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
@kennylugo
kennylugo / syncMaster&Gh-pages.txt
Last active December 28, 2015 17:48
How to keep the MASTER & GH-PAGES branch in sync
1) git checkout master
2) git status
3) git commit -am "test"
4) git push origin master
5) git checkout gh-pages
6) git rebase master
7) git push origin gh-pages
8) git checkout master
@kennylugo
kennylugo / linkToTut.txt
Created December 28, 2015 18:44
Align text to the top left of the label
http://stackoverflow.com/questions/1054558/vertically-align-text-within-a-uilabel
@kennylugo
kennylugo / viewDidLoad.swift
Last active December 29, 2015 23:11
Control UI objects visibility - Used this code on UIPageViewController
//this goes right under the declaration of the class : @IBOutlet weak var getStartedButton:UIButton!
//CONTROL VISIBILITY OF BUTTON; WILL ONLY SHOW ON THE SIXTH VC (INDEX 6);
getStartedButton.hidden = (index == 6) ? false : true // Will hide from indexes 0 - 6
skipButton.hidden = (index == 6) ? true : false // Will show from indexes 0 - 6
@kennylugo
kennylugo / viewDidLoad.swift
Created January 3, 2016 20:42
Give a UITableViewController a background image
tableView.backgroundView = UIImageView(image: UIImage(named: "SITC Background (Purple)"))
@kennylugo
kennylugo / TripletInterfaces.swift
Last active January 11, 2016 21:44
NYCDA's Triplet Interfaces Programatically
//
// ViewControllerC.swift
// TripletInterfaces
//
// Created by Kenny Batista on 6/16/15.
// Copyright (c) 2015 Kenny Batista. All rights reserved.
//
import UIKit
@kennylugo
kennylugo / ProgramaticButton.Swift
Last active January 16, 2016 00:49
ProgramaticButton
override func viewDidLoad() {
super.viewDidLoad()
let button = UIButton(type: UIButtonType.System) as UIButton
button.frame = CGRectMake(100, 100, 100, 100)
button.backgroundColor = UIColor.redColor()
button.setTitle("Touch for a hello greeting", forState: .Normal)
self.view.addSubview(button)
}
//
// ViewController.swift
// HelloWorld
//
// Created by Kenny Batista on 1/15/16.
// Copyright © 2016 Kenny Batista. All rights reserved.
//
import UIKit
//
// ViewController.swift
// thirdtableview
//
// Created by Kenny Batista on 2/19/16.
// Copyright © 2016 Kenny Batista. All rights reserved.
//
import UIKit