Skip to content

Instantly share code, notes, and snippets.

Joseadrian Ochoa joseadrian

  • Lima, Perú
Block or report user

Report or block joseadrian

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 responsive-youtube.css
iframe[attribute*=youtube] {
width: 100%;
}
@joseadrian
joseadrian / README.md
Created Nov 9, 2017 — forked from addyosmani/README.md
108 byte CSS Layout Debugger
View README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@joseadrian
joseadrian / acf-fields.php
Created Apr 4, 2017 — forked from hereswhatidid/acf-fields.php
Create custom product details tabs within WooCommerce using an ACF (Advanced Custom Fields) Repeater field.
View acf-fields.php
<?php
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'acf_product_options',
'title' => 'Product Options',
'fields' => array (
array (
'key' => 'acf_product_options_tabbedcontent_label',
'label' => 'Tabbed Content',
@joseadrian
joseadrian / reset.sass
Created Apr 4, 2016 — forked from trey/reset.sass
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
View reset.sass
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@joseadrian
joseadrian / my_activity.xml
Last active Aug 7, 2018
Remove glow / edges on Navigation View
View my_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
@joseadrian
joseadrian / ip.conf
Created Oct 28, 2015 — forked from mishak87/ip.conf
Nginx: Support only requests with Host header (disable access via bare IP)
View ip.conf
# this file blocks ip requests - only request with Host are supported
server {
listen 80 default_server;
listen 443 default_server ssl;
server_name _;
return 444;
}
@joseadrian
joseadrian / responsive_likebox.html
Created Oct 27, 2015
Responsive Facebook Like Box
View responsive_likebox.html
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container" style="width:100%;">
<div class="fb-like-box" data-href="https://www.facebook.com/adobegocreate" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
</div>
View hexToRGB.php
<?php
var_dump (
array_combine(['r','g','b'], sscanf('FF0000', "%02x%02x%02x"))
);
@joseadrian
joseadrian / validate-selectize-fields.js
Created Oct 2, 2015 — forked from yannleretaille/validate-selectize-fields.js
How to validate selectize.js comboboxes with the jQuery validation plugin
View validate-selectize-fields.js
//How to validate selectize.js comboboxes with the jQuery validation plugin
//selectize.js: http://brianreavis.github.io/selectize.js/ (brianreavis/selectize.js)
//http://jqueryvalidation.org (jzaefferer/jquery-validation)
//configure jquery validation
$("#commentForm").validate({
//the default ignore selector is ':hidden', the following selectors restore the default behaviour when using selectize.js
//:hidden:not([class~=selectized]) | selects all hidden elements, but not the original selects/inputs hidden by selectize
//:hidden > .selectized | to restore the behaviour of the default selector, the original selects/inputs are only validated if their parent is visible
//.selectize-control .selectize-input input | this rule is not really necessary, but ensures that the temporary inputs created by selectize on the fly are never validated
@joseadrian
joseadrian / console-query.php
Created Aug 24, 2015
Log queries in console
View console-query.php
<?php
Event::listen('illuminate.query', function($query, $binding, $time, $connections)
{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
foreach ($backtrace as $trace) {
if(array_key_exists('file',$trace) && array_key_exists('line',$trace)){
if( strpos($trace['file'],base_path().'/app') !== false ){
PhpConsole\Handler::getInstance()->debug([
You can’t perform that action at this time.