Skip to content

Instantly share code, notes, and snippets.

View jlcampana's full-sized avatar
:octocat:
emu emu emu...

Jose Luis Campaña jlcampana

:octocat:
emu emu emu...
View GitHub Profile
@jlcampana
jlcampana / gist:2884d11de836108b8847
Created November 20, 2014 12:58
remove .git recursively
find . -name ".git" | xargs rm -rf
Express:
sudo npm install -g generator-express
AngularJS:
sudo npm install -g generator-angular
Crear app:
yo
@jlcampana
jlcampana / radio.js
Created September 9, 2014 09:28
Acceder a un radio button
<br><label>Color: </label>
<ul>
<label class="radio-inline">
<input type="radio" name="color" id="color1" value="label-warning" checked> <h4><span class="label label-warning">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color2" value="label-danger"> <h4><span class="label label-danger">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color3" value="label-info"> <h4><span class="label label-info">Etiqueta</span></h4>
@jlcampana
jlcampana / mongodb_document_exists_optimized.py
Last active August 29, 2015 14:05
Mongo: check if exist element (optimized)
#estamos guardando de un CSV y no tenemos PK
def get_db():
from pymongo import MongoClient
client = MongoClient('localhost:27017')
db = client.dineros
return db
def storeData(data):
db = get_db()
@jlcampana
jlcampana / gist:1b5e623c39587b032873
Created July 24, 2014 13:14
form submit iExplorer 8
if (event.submit) {
event.submit();
} else {
event.returnValue = true;
}
@jlcampana
jlcampana / gist:2a920e99135c94322cfc
Created July 23, 2014 13:56
preventDefault en iExplorer<11
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
@jlcampana
jlcampana / parser.js
Created June 17, 2014 18:37
NodeJS Module
var parserRarbg = function(html){
return 'pepe';
};
//Definiciones públicas
exports.parserRarbg = parserRarbg;
[self.navigationBar setBackgroundImage:[UIImage new]
forBarMetrics:UIBarMetricsDefault];
self.navigationBar.shadowImage = [UIImage new];
self.navigationBar.translucent = YES;
@jlcampana
jlcampana / checks.h
Created May 21, 2014 07:12
Check IOS version (preprocessor macro)
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
//Example: SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.1") ? 0.0f : 0.5f;
//Example: SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6")
@jlcampana
jlcampana / slowanim.m
Created April 11, 2014 09:19
Enable slow animations
//To enable slow animations you can add a line of code to the “applicationDidBecomeActive”.
[UIApplication.sharedApplication.keyWindow.layersetSpeed:0.1f];