Skip to content

Instantly share code, notes, and snippets.

View mako34's full-sized avatar
💭
automagickally

manuelBetancurt mako34

💭
automagickally
View GitHub Profile
//MyCell.h
@protocol MyCellDelegate <NSObject>
-(void)cellCheckBoxWasChanged:(MyCell *)cell;
@end
@interface MyCell : NSObject
//http://everybody.is-a-cyb.org/project/21
//PROCESSING WRITES TO ARDUINO
import processing.serial.*;
// The serial port:
Serial myPort;
int value = 0;
@mako34
mako34 / processing2ardu
Created March 29, 2014 12:16
Processing talks to Arduino
//http://everybody.is-a-cyb.org/project/21
//PROCESSING WRITES TO ARDUINO
import processing.serial.*;
// The serial port:
Serial myPort;
int value = 0;
@mako34
mako34 / iOS_blocks
Last active January 4, 2016 15:59
iOS blocks,
// since iOS 4, extension C lang
//AKA, lambdas, anonimous functions, clousures
//function that can be stored as a variable (referred to as a "first-class function")
//clousure scope incorporates parent scope "close"
//encapsulate chunks of code and pass them around like any other object
//As well as containing executable code, a block also has the ability to capture state from its enclosing scope.
@mako34
mako34 / PHP_push_iOS.php
Last active May 3, 2020 13:04
PHP test for iOS push notification
<?php
// Provide the Host Information.
$tHost = 'gateway.sandbox.push.apple.com';
$tPort = 2195;
// Provide the Certificate and Key Data.
@mako34
mako34 / delegate reminder
Last active December 28, 2015 15:39
iOS, objC : delegate reminder
/////
# MyMuch.h
@protocol MyMuchDelegate;
@interface MyMuch : MyMuchViewController
{
//id<MyMuchDelegate> _delegate; //new style not needed
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return objectArray.count;
}
@mako34
mako34 / python_simple_chat
Created October 23, 2013 05:28
Python simple chat test, server and client
#server
# TCP Server Code
#host="127.0.0.1" # Set the server address to variable host
host="127.168.2.75" # Set the server address to variable host
port=4446 # Sets the variable port to 4444
from socket import * # Imports socket module
s=socket(AF_INET, SOCK_STREAM)
s.bind((host,port)) # Binds the socket. Note that the input to
@mako34
mako34 / json_array_or_obj
Created September 27, 2013 04:40
Android / Java check a json to know if is an object or array
JSONObject json;
Object intervention;
JSONArray interventionJsonArray;
JSONObject interventionObject;
json = RestManager.getJSONfromURL(myuri); // retrieve the entire json stream
Object intervention = json.get("intervention");
if (intervention instanceof JSONArray) {
// It's an array
interventionJsonArray = (JSONArray)intervention;
@mako34
mako34 / iOS ui element
Created September 17, 2013 04:17
android vs iOS UIElement , comparados
textField
. iOS : UITextField
. android: EditText