Skip to content

Instantly share code, notes, and snippets.

View mraaroncruz's full-sized avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / xcode.md
Created June 26, 2014 15:37
xcode talk outline

Prototyping in Xcode talk

Intro

You can build working prototypes in Xcode without a line of code

Fundamentals

To understand what is going on you need to understand a few concepts

View controllers

A view controller is an piece of code that has 3 main responsibilities

  1. it handles user interaction - tap on twitter posts menu item
@mraaroncruz
mraaroncruz / resolutions.md
Created September 13, 2014 11:31
itunes image resolutions

iTunes Image resolutions

For images like
http://a2.mzstatic.com/us/r30/Features/9f/d0/24/dj.qpfivssw.170x170-75.jpg you can replace the 170x170 with one of these below

  • 100x100
  • 110x110
  • 150x150
  • 167x167
  • 170x170
-- Add the new tsvector column
ALTER TABLE articles ADD COLUMN tsv tsvector;
-- Create a function that will generate a tsvector from text data found in both the
-- title and body columns, but give a higher relevancy rating 'A' to the title data
CREATE FUNCTION articles_generate_tsvector() RETURNS trigger AS $$
begin
new.tsv :=
setweight(to_tsvector('pg_catalog.english', coalesce(new.title,'')), 'A') ||
setweight(to_tsvector('pg_catalog.english', coalesce(new.body,'')), 'B');
@mraaroncruz
mraaroncruz / error.txt
Created November 9, 2014 20:44
rubygems timeout error
~/W/d/app git:master ❯❯❯ bundle install --verbose ✖ ✱ ◼
HTTP GET https://bundler.rubygems.org/api/v1/dependencies
HTTP 200 OK
Fetching source index from https://rubygems.org/
qkGem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/specs.4.8.gz)
/Users/aaron/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/rubygems/remote_fetcher.rb:290:in `rescue in fetch_path'
//...
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
@mraaroncruz
mraaroncruz / error.txt
Created November 9, 2014 20:58
more timeout
Using friendly_id 5.0.4
Installing rb-fsevent 0.9.4
Installing rb-inotify 0.9.5
Installing listen 2.7.11
Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/gems/lumberjack-1.0.9.gem)
An error occurred while installing lumberjack (1.0.9), and Bundler cannot continue.
Make sure that `gem install lumberjack -v '1.0.9'` succeeds before bundling.
@mraaroncruz
mraaroncruz / repos.md
Created February 24, 2015 12:02
repos to read for Herding Gophers talk Gophercon India 2015

Link to typeform

https://typeform.com

Golang Repo Links

Here are lists of repos from the most prolific Go project creators

Hashicorp

@mraaroncruz
mraaroncruz / pg.zsh
Created June 25, 2015 14:45
postgres helpers for .zshrc
# PostgreSQL
pg () {
DATA="$1"
PORT=${2-5432}
postgres -D $DATA -p $PORT
}
create-project-db () {
U=$1
DB=$2
//
// ActivityStore.swift
// Whacha Doin
//
// Created by Aaron Cruz on 6/21/15.
// Copyright (c) 2015 Aaron Cruz. All rights reserved.
//
import Foundation
import SQLite
# Part of this borrowed from a jekyll deploy script from the jekyll author.
# This assumes sprockets and juicer which will combine your js modules and yui compress them respectively
BASE = File.dirname(__FILE__)
SRC = "#{BASE}/src"
SITE = "#{BASE}/site"
JSFILE = "javascript.js"
task :default => [:js,:build]
@mraaroncruz
mraaroncruz / imagefield_widget.php
Created December 3, 2010 18:54
i want my widget!
<?php
**
* Implementation of hook_form();
*/
// THIS CODE DOESN'T WORK!!! well, i mean, it works, but id doesn't do what it is supposed to do...
function community_form(&$node, $form_state) {
$type = node_get_types('type', $node);
// We need to define form elements for the node's title and body.
$form['title'] = array(