Skip to content

Instantly share code, notes, and snippets.

Junrill Galvez junrillg

Block or report user

Report or block junrillg

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
@junrillg
junrillg / gist:f1d6b2c05bf473c966947f2cc27815dc
Created May 22, 2016 — forked from romainneutron/gist:5340930
Download large files using Guzzle
View gist:f1d6b2c05bf473c966947f2cc27815dc
<?php
use Guzzle\Http\Client;
require __DIR__ . '/vendor/autoload.php';
$tmpFile = tempnam(sys_get_temp_dir(), 'guzzle-download');
$handle = fopen($tmpFile, 'w');
$client = new Client('', array(
Client::CURL_OPTIONS => array(
View NSData+OADataHelpers.m
#import "NSData+OADataHelpers.h"
@implementation NSData (OADataHelpers)
- (NSString*) UTF8String
{
return [[[NSString alloc] initWithData:[self dataByHealingUTF8Stream] encoding:NSUTF8StringEncoding] autorelease];
}
// Replaces all broken sequences by � character and returns NSData with valid UTF-8 bytes.
@junrillg
junrillg / UIColor+HexString.h
Created Apr 4, 2016 — forked from codingrhythm/UIColor+HexString.h
Objective-C class to convert hex string to UIColor. Support #RGB # ARGB #RRGGBB #AARRGGBB Usage: [UIColor colorWithHexString:@"#f5e6a1"];
View UIColor+HexString.h
//
// UIColor+HexString.h
// Class to convert hex string to UIColor
// Support #RGB # ARGB #RRGGBB #AARRGGBB
// Usage: [UIColor colorWithHexString:@"#f5e6a1"];
// Created by Zhu Yuzhou on 1/20/13.
//
#import <UIKit/UIKit.h>
@junrillg
junrillg / .vimrc
Created Feb 3, 2016
Basic .vimrc settings without plugins
View .vimrc
set nocompatible
filetype on
filetype indent on
filetype plugin on
let mapleader = "."
syntax enable
set foldmethod=syntax
set ignorecase
set hlsearch
@junrillg
junrillg / ajax_request
Last active Nov 25, 2015
Platypus WP Ajax Request Guide
View ajax_request
==============================================
PHP FILE
==============================================
add_action( 'wp_ajax_sample_action', 'my_action_callback' );
add_action( 'wp_ajax_nopriv_sample_action', 'my_action_callback' );
function my_action_callback(){
$_POST['his_not_email'];
View paypalCurrencySelectDropDown.html
<select name="currency_code">
<option value="">Select Currency</option>
<option value="AUD">Australian Dollar</option>
<option value="BRL">Brazilian Real </option>
<option value="CAD">Canadian Dollar</option>
<option value="CZK">Czech Koruna</option>
<option value="DKK">Danish Krone</option>
<option value="EUR">Euro</option>
<option value="HKD">Hong Kong Dollar</option>
<option value="HUF">Hungarian Forint </option>
@junrillg
junrillg / README.md
Created Oct 13, 2015 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@junrillg
junrillg / gist:4683e46b2ae170aba51d
Created Oct 8, 2015
Laravel Login/Register Views
View gist:4683e46b2ae170aba51d
<!-- resources/views/auth/login.blade.php -->
<form method="POST" action="/auth/login">
{!! csrf_field() !!}
<div>
Email
<input type="email" name="email" value="{{ old('email') }}">
</div>
@junrillg
junrillg / WP:Set 404 in WordPress
Created Aug 26, 2015
WP:Set 404 in WordPress
View WP:Set 404 in WordPress
global $wp_query;
$wp_query->set_404();
status_header(404);
You can’t perform that action at this time.