Skip to content

Instantly share code, notes, and snippets.

View junrillg's full-sized avatar
💻
Got something to work?

Junrill Galvez junrillg

💻
Got something to work?
View GitHub Profile
@junrillg
junrillg / gist:f1d6b2c05bf473c966947f2cc27815dc
Created May 22, 2016 12:21 — forked from romainneutron/gist:5340930
Download large files using Guzzle
<?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(
#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 April 4, 2016 00:00 — forked from codingrhythm/UIColor+HexString.h
Objective-C class to convert hex string to UIColor. Support #RGB # ARGB #RRGGBB #AARRGGBB Usage: [UIColor colorWithHexString:@"#f5e6a1"];
//
// 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 February 3, 2016 06:02
Basic .vimrc settings without plugins
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 November 25, 2015 01:05
Platypus WP Ajax Request Guide
==============================================
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'];
@junrillg
junrillg / paypalCurrencySelectDropDown.html
Last active November 20, 2015 20:50 — forked from biswarupadhikari/paypalCurrencySelectDropDown.html
Paypal Currency Select Drop Down
<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 October 13, 2015 06:43 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@junrillg
junrillg / gist:4683e46b2ae170aba51d
Created October 8, 2015 04:44
Laravel Login/Register Views
<!-- 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>
git fetch --all
git reset --hard origin/master
@junrillg
junrillg / WP:Set 404 in WordPress
Created August 26, 2015 16:52
WP:Set 404 in WordPress
global $wp_query;
$wp_query->set_404();
status_header(404);