Skip to content

Instantly share code, notes, and snippets.

View vaporic's full-sized avatar
🏠
Working from home

Hugo Epinosa vaporic

🏠
Working from home
View GitHub Profile
@vaporic
vaporic / regex_validation_link.php
Created May 31, 2019 13:28
Regex validation url - laravel
@vaporic
vaporic / Response Json Rates
Created April 25, 2019 01:53
Response Json Rates
{"warning":[],"fedex":[{"rate_id":"40978679","shipment_id":"4360968","dynamic_service_name":"Envío estandard (5 días)","date":"2019-04-24T20:52:10.118-05:00","carrier":"fedex","carrier_service_name":"Express Saver","carrier_service_code":"FEDEX_EXPRESS_SAVER","carrier_logo_url":"https://enviaya-public.s3-us-west-1.amazonaws.com/images/fedex.png","carrier_logo_url_svg":"https://enviaya-public.s3-us-west-1.amazonaws.com/images/fedex.svg","estimated_delivery":"2019-04-29","net_shipping_amount":135.96,"net_surcharges_amount":19.44,"net_total_amount":155.4,"vat_amount":24.86,"vat_rate":16.0,"total_amount":180.26,"currency":"MXN","list_total_amount":212.07,"list_total_amount_currency":"MXN","subsidy_net_amount":0.0,"service_terms":"","surcharges_break_down":[{"carrier_surcharge_name":"Fuel","surcharge_net_amount":16.01,"surcharge_vat":2.56,"surcharge_total":18.57}],"enviaya_service_name":"Nacional económico","enviaya_service_code":"fedex_express_saver"},{"rate_id":"40978678","shipment_id":"4360968","dynamic_service
@vaporic
vaporic / mouseout.js
Created July 13, 2018 13:35
Script Antes de que te vayas
function window_mouseout( obj, evt, fn ) {
if ( obj.addEventListener ) {
obj.addEventListener( evt, fn, false );
}
else if ( obj.attachEvent ) {
obj.attachEvent( 'on' + evt, fn );
}
@vaporic
vaporic / curl.php
Created July 5, 2018 21:48
Example Curl PHP
<?php
$data = array("username" => "test"); // data u want to post
$data_string = json_encode($data);
$api_key = "your_api_key";
$password = "xxxxxx";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://xxxxxxxxxxxxxxxxxxxxxxx");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
@vaporic
vaporic / embedded-file-viewer.md
Created June 5, 2018 21:52 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@vaporic
vaporic / usb_boot_macos.txt
Created May 10, 2018 20:35
Usb Booteable Terminal MacOS
COMANDOS A EJECUTAR:
1. diskutil list
2. diskutil unmountdisk /dev/disk1
3. sudo dd if= (Arrastramos archivo iso) of=/dev/disk1 bs=1m
4. Password
5. diskutil eject /dev/disk1
@vaporic
vaporic / readme.md
Created November 24, 2017 17:59 — forked from lenivene/readme.md
Get YouTube url ID

Example code

$link = "https://www.youtube.com/watch?v=sOnqjkJTMaA";
$youtube_ID = get_youtube_ID( $link );

echo $youtube_ID;
<?php
/**
* Get Vimeo video id from url
*
* Supported url formats -
*
* https://vimeo.com/11111111
* http://vimeo.com/11111111
@vaporic
vaporic / accordion.js
Created July 14, 2017 16:07
Accordion with plus/minus icon
function toggleIcon(e) {
$(e.target)
.prev('.panel-heading')
.find(".more-less")
.toggleClass('glyphicon-plus glyphicon-minus');
}
$('.panel-group').on('hidden.bs.collapse', toggleIcon);
$('.panel-group').on('shown.bs.collapse', toggleIcon);
@vaporic
vaporic / avatar.html
Last active June 26, 2017 19:42
Avatar Generator from Name
<canvas id="user-icon" width="256" height="256"></canvas>