Skip to content

Instantly share code, notes, and snippets.

View ccabanero's full-sized avatar

Clint Cabanero ccabanero

View GitHub Profile
@ccabanero
ccabanero / iOS - Making the status bar text white in iOS 7
Last active April 8, 2016 01:52
iOS - Making the status bar text white in iOS 7
1. In the project's info.plist. Add the key 'View controller-based status bar appearanced' with the value 'NO'.
2. In the Application Delegate's 'didFinishLaunching' add
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
Code snippet ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
@ccabanero
ccabanero / AWS - S3 bucket policy for using to host static web pages.
Created December 18, 2013 11:28
AWS - S3 bucket policy for using to host static web pages.
{
"Version":"2008-10-17",
"Statement":[{
"Sid":"Allow Public Access to All Objects",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example.com/*"
@ccabanero
ccabanero / AWS - S3 bucket policy - allow user to use AWS console to view S3 buckets and have read and write permission on a single specified bucket
Created December 19, 2013 15:10
AWS - S3 bucket policy - allow user to use AWS console to view S3 buckets and have read and write permission on a single specified bucket
1. Use Identity and Access Manager (IAM) in the AWS console.
2. Create a group or user. Create a password so that the user can use it to authenticate your organization's AWS console.
3. Go to the group's (or user's) profile. Go to Permissions. Add the following policy.
{
"Statement": [
{
@ccabanero
ccabanero / AWS - S3 Public Bucket Policy
Last active September 10, 2019 06:39
AWS - S3 Public Bucket Policy
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@ccabanero
ccabanero / AWS - S3 PublicRead Bucket Policy
Created January 30, 2014 13:37
AWS - S3 PublicRead Bucket Policy
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@ccabanero
ccabanero / Installing SASS - Ubuntu 12
Created February 5, 2014 18:40
Installing SASS - Ubuntu 12
--installing ruby
sudo apt-get install ruby-full build-essential
--installing rubygems
sudo apt-get install rubygems
--install sass
sudo gem install sass
@ccabanero
ccabanero / Batch upload files from Mac to EC2 Micro Linux Instance
Last active October 12, 2018 19:07
Batch upload/download files from Mac to EC2 Ubuntu - Download File from EC2 Ubuntu to Mac
Uploading from Mac Terminal to Remote EC2 ...
scp -i [yourpemfile.pem] [directoryPath]/* [user]@[elastic IP]:[directoryPathToUploadTo]
For example ...
scp -i chubbs_spat.pem arab_data/* ubuntu@11.22.33.44:PGRestAPI/endpoints/mapnik/data/shapefiles/
Downloading from EC2 Ubuntu to Mac Terminal...
scp -i [yourpemfile.pem] [user]@[elastic IP]:[diretoryPthToFileToDownloadFrom] [directoryPathToDownloadTo]
@ccabanero
ccabanero / Swift Reference
Created June 3, 2014 13:15
Swift Reference
import UIKit
// variable
var myVariable = 3
myVariable += 1
@ccabanero
ccabanero / Count lines of code in Xcode project
Created August 9, 2014 12:14
Count lines of code in Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.[hm]" -print0 | xargs -0 wc -l
@ccabanero
ccabanero / Sample iOS Unit Tests: Working with a ViewController composed of TableViews
Last active November 9, 2023 09:00
Sample iOS Unit Tests: Working with a ViewController composed of TableViews
import XCTest
@testable import YourAppTargetname
class SideMenuViewControllerTest: XCTestCase {
var viewControllerUnderTest: SideMenuViewController!
override func setUp() {
super.setUp()