Skip to content

Instantly share code, notes, and snippets.

Oscar Arzola arzola

Block or report user

Report or block arzola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7fd49d153f2837c0313e3c50c655d304
curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@
@arzola
arzola / RefactorToCollection.php
Last active Jun 23, 2017
Refactor to collection
View RefactorToCollection.php
$tweets = Datostwitter::orderBy('hora', 'desc')->take(Settings::get('twitter_max'))->get();
$pagetweets = [];
$total = count($tweets);
$itemtw = [];
for ($i = 0; $i < $total; $i+=5){
for ($n = 0; $n < 5; $n++){
if (isset($tweets[$i+$n])){
@arzola
arzola / entrans
Created Nov 25, 2014
End Transition
View entrans
$("#list_container").on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function (e) {
if (e.target == this) {
tpListingSearchResults.shuffleObj.shuffle('layout');
}
});
@arzola
arzola / regex_replace
Created Nov 5, 2014
Regex to convert coordinates string to Google Maps Points
View regex_replace
//str example
-87.6361173230483,41.9184733663886,0 -87.63625063290191,41.9186879407643,0 -87.63638917236651,41.9188946307294,0 -87.63638597726001,41.9196072396054,0 -87.63640288658171,41.9201768975391,0 -87.6364176789852,41.9206761120529,0 -87.6364281700465,41.921033421017,0 -87.6364463383626,41.9216235169182,0 -87.636450850147,41.921817693737,0 -87.63645747855981,41.9219928494608,0 -87.6364639198159,41.9221636969844,0 -87.6364641782462,41.9221721963153
(-\d\d\.+(\d)*)+,(\d\d\.+(\d)*)+,(0)
Regex replace
new google.maps.LatLng($1,$3),
@arzola
arzola / singletonobj
Created Sep 12, 2014
Singleton Objetive C
View singletonobj
+ (SPProgress *)sharedInstance {
static dispatch_once_t pred;
static SPProgress *shared = nil;
dispatch_once(&pred, ^{
shared = [[SPProgress alloc] init];
shared.eneArray = [[NSMutableArray alloc]init];
});
return shared;
}
View ajaxjquery
$.ajax({
url: '/url',
data: params,
type: 'post',
dataType: 'json',
success: function(response) {
},
error: function(response) {
@arzola
arzola / isnumeric
Created Sep 11, 2014
isNumeric Javascript
View isnumeric
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
return (charCode <= 31 || charCode === 46 || (charCode >= 48 && charCode <= 57));
}
@arzola
arzola / embed_image
Created May 19, 2014
Add Embed Image with PhpMailer
View embed_image
<?php
$mail->AddEmbeddedImage("rocks.png", "my-attach", "rocks.png");
$mail->Body = 'Your <b>HTML</b> with an embedded Image: <img src="cid:my-attach"> Here is an image!';
@arzola
arzola / topView
Created Mar 21, 2014
Add Top Border to UIView
View topView
CALayer *TopBorder = [CALayer layer];
TopBorder.frame = CGRectMake(0.0f, 0.0f, self.scrollView.frame.size.width, 1.0f);
TopBorder.backgroundColor = UIColorFromRGB(0xff716b).CGColor;
[self.scrollView.layer addSublayer:TopBorder];
View headerview
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 60)];
headerView.backgroundColor = [UIColor clearColor];
UIView *label = [[UIView alloc] initWithFrame: CGRectMake(0,0, 50, 50)];
label.backgroundColor = [UIColor yellowColor];
label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
[headerView addSubview:label];
You can’t perform that action at this time.