Skip to content

Instantly share code, notes, and snippets.

View nebiros's full-sized avatar

Juan Alvarez nebiros

View GitHub Profile
NSArray *recordIds = [self.people valueForKey:@"recordID"];
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[recordIds count]];
for (id recordId in recordIds) {
NSLog(@"recordId 1, %@", recordId);
NSLog(@"recordId 2, %@", @((ABRecordID) recordId));
NSLog(@"recordId 3, %d", (ABRecordID) recordId);
NSLog(@"recordId 4, %@", [NSNumber numberWithInt:(ABRecordID) recordId]);
ABRecordID r = (ABRecordID) recordId;
[arr addObject:[NSNumber numberWithInt:r]];
}
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_MKMapView", referenced from:
l244 in SparkInspector(SparkInspector)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
// An implementation.
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
// if (!self.isThingsSaved) {
// [self saveThings];
// }
[self saveThings];
- (void)updateViewConstraints
{
[self setupTableViewHeader];
[super updateViewConstraints];
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
//
// THTAddThreeThingsTableHeaderView.m
// ThreeThings
//
// Created by Juan Felipe Alvarez Saldarriaga on 3/3/14.
// Copyright (c) 2014 3Things. All rights reserved.
//
#import "THTAddThreeThingsTableHeaderView.h"
#import <RHAddressBook/RHPerson.h>
@nebiros
nebiros / _create_url.php
Created April 23, 2014 20:33
builds current url, like http://blah.com/some/folders/inside, https://blah.com or create a new one using a path and a query string.
<?php
function _create_url($uri = null) {
$url = "http";
switch (true) {
case (isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on" || $_SERVER["HTTPS"] === true)):
case (isset($_SERVER["HTTP_SCHEME"]) && ($_SERVER["HTTP_SCHEME"] == "https")):
case (isset($_SERVER["SERVER_PORT"]) && ($_SERVER["SERVER_PORT"] == 443)):
$url .= "s";
@nebiros
nebiros / html2canvas.js
Created April 23, 2014 21:33
takes a screenshot from some html element with html2canvas.js and save it to server with PHP.
html2canvas(document.getElementById("an_element_id"), {
onrendered: function(canvas) {
var img = canvas.toDataURL("image/png");
$.post("http://blah.com", {image_data: img}, function (data, textStatus, jqXHR) {
console.log(arguments);
});
}
});
@nebiros
nebiros / IndexController.php
Created November 30, 2009 12:56
Zend_Filter_Input on steroids
<?php
class IndexController extends Zend_Controller_Action {
public function someAction() {
if ( true === $this->getRequest()->isPost() ) {
// Validate form.
$someForm = new App_Filter_Input_SomeForm();
$someForm->setData( $this->getRequest()->getPost() );
if ( false === $someForm->isValid() ) {
#
# How to install php/java bridge on Ubuntu.
#
# aptitude install sun-java6-jre sun-java6-fonts sun-java6-jdk liblucene-java libitext-java \
php5-dev php5-cgi libtcnative-1
# update-java-alternatives -s java-6-sun
# dpkg --force-architecture -i php-java-bridge_5.4.4.2-3_i386.deb
@nebiros
nebiros / index.php
Created January 14, 2010 15:53
How to implement Zend_Paginator without Zend
<?php
defined( "APPLICATION_PATH" )
|| define( "APPLICATION_PATH", realpath( dirname( __FILE__ ) ) );
// Ensure library/ is on include_path.
set_include_path( implode( PATH_SEPARATOR, array(
realpath( APPLICATION_PATH . "/library" ), // Aca va a estar la carpeta Zend que viene con el .tag.gz del ZF
get_include_path(),
) ) );