Skip to content

Instantly share code, notes, and snippets.

View gist:8741901
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]];
}
View gist:8809954
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)
View gist:8963499
// An implementation.
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
// if (!self.isThingsSaved) {
// [self saveThings];
// }
[self saveThings];
View gist:9330034
- (void)updateViewConstraints
{
[self setupTableViewHeader];
[super updateViewConstraints];
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
View THTAddThreeThingsTableHeaderView.m
//
// 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 Apr 23, 2014
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.
View _create_url.php
<?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 Apr 23, 2014
takes a screenshot from some html element with html2canvas.js and save it to server with PHP.
View html2canvas.js
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 Nov 30, 2009
Zend_Filter_Input on steroids
View IndexController.php
<?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() ) {
View gist:246891
#
# 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 Jan 14, 2010
How to implement Zend_Paginator without Zend
View index.php
<?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(),
) ) );
You can’t perform that action at this time.