Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseadrian Ochoa joseadrian

View GitHub Profile
@joseadrian
joseadrian / app.js
Created Jun 18, 2020 — forked from kwhinnery/app.js
HTTP Basic Authentication with Express 4 using the http-auth module
View app.js
var express = require('express'),
auth = require('http-auth');
// Configure basic auth
var basic = auth.basic({
realm: 'SUPER SECRET STUFF'
}, function(username, password, callback) {
callback(username == 'admin' && password == 'f00lpr00f');
});
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"))
);