Skip to content

Instantly share code, notes, and snippets.

View a-bx's full-sized avatar

Abraham Barrera a-bx

  • Migrante
  • Chile
View GitHub Profile
@a-bx
a-bx / gist:1297197
Created October 19, 2011 00:44
Setup Rhodes
$ gem install rhodes
$ rhodes app test_rhodes http://localhost:3000
$ rake run:iphone
@a-bx
a-bx / gist:1297458
Created October 19, 2011 04:08
Titanium Coffe
Test_titanium.App.tabGroup = Ti.UI.createTabGroup()
sampleWindow = Test_titanium.Views.Sample.createMainWindow
title: 'Sample'
id: 'sampleWindow'
orientationModes: Test_titanium.Helpers.Application.createOrientiationModes
Test_titanium.App.sampleWindow = Ti.UI.createTab
id: 'sampleTab'
className: 'tabElement'
@a-bx
a-bx / gist:1297512
Created October 19, 2011 05:11
Uso Módulo Titanium
var elmodulo = require('org.adamantio.mimodulo');
elmodulo.hacer_algo();
@a-bx
a-bx / uiwebview_zoom.m
Created December 13, 2011 16:02
How to reset UIWebView's zoom
UIScrollView *sv = nil;
// if iOS5 the scrollView property exists!
if ([self.webView respondsToSelector:@selector(scrollView)])
sv = webView.scrollView;
else
sv = [webView.subviews objectAtIndex:0];
CGSize theSize = [sv contentSize];
@a-bx
a-bx / stopsopa.html
Created January 18, 2012 13:26
STOP SOPA
<a style=display:scroll;position:fixed;top:0px;right:0px;
href="http://americancensorship.org/" target="_blank">
<img style="border:0;" src="http://2.bp.blogspot.com/-vkrUQQf0oRk/TxSYo4vMEcI/AAAAAAAABh8/_pDXwiO49pc/s1600/stop-sopa-ribbon.png" />
</a>
@a-bx
a-bx / copy_git.sh
Created March 8, 2012 14:40
Copy git repositories with all history
#Origin
$ git clone <origin repo>
$ cd <origin directory>
$ git remote rm origin
$ git filter-branch --subdirectory-filter ./ -- --all
$ git add .
$ git commit
$ pwd
#Target
[{
"type": "rhyboo.start",
"ts": "2012-05-02T21:21:19.592+0000",
"data": {
"tz": -240,
"nettype": "WIFI",
"osname": "iphone",
"un": "iPhone Simulator",
"osarch": "x86_64",
"osver": "5.0",
@a-bx
a-bx / coolstrappiscool.js
Created May 16, 2012 14:44
Coolstrap is COOL
COOL.Boot = (function(coolstrap, undefined) {
return function() {
};
})(COOL);
@a-bx
a-bx / using_universal_ws_client.js
Created June 13, 2012 14:21
Using Universal Websocket Client
//configure websocket servers
var ws_servers = [
{ host: "socket1.example.com",
port: "8080"},
{ host: "socket2.example.com",
port: "8080"}];
//connect to any server
//(recconect and time are optional)
WSClient = new RhybooWS({
@a-bx
a-bx / gist:3612393
Created September 3, 2012 19:01
APNS - Create Conncectino
var apns = require('apn');
var options = {
cert: __dirname + '/../config/keys/aps_cert_' + env + '.pem',
certData: null,
key: __dirname + '/../config/keys/aps_key_' + env + '.pem',
keyData: null,
gateway: env == 'production' ? 'gateway.sandbox.push.apple.com' : 'gateway.sandbox.push.apple.com',
port: 2195,
enhanced: true,
errorCallback: function(errorCode, note){