Skip to content

Instantly share code, notes, and snippets.

View onigetoc's full-sized avatar

Gino onigetoc

View GitHub Profile
/**
* Hide the addressbar on ios & android devices
* https://gist.github.com/yckart/5609969
*
* Based on the work from Nate Smith
* @see https://gist.github.com/nateps/1172490
*
* Copyright (c) 2013 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/05/20
@onigetoc
onigetoc / bootstrap-wrapper.css
Created December 28, 2015 19:51
Bootstrap wrapper no conflict - Wrap Bootstrap v3.3.6 CSS inside a div with the class .bootstrap-wrapper
.bootstrap-wrapper {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
/*.bootstrap-wrapper body{margin:0}*/
.bootstrap-wrapper article, .bootstrap-wrapper aside, .bootstrap-wrapper details, .bootstrap-wrapper figcaption, .bootstrap-wrapper figure, .bootstrap-wrapper footer, .bootstrap-wrapper header, .bootstrap-wrapper hgroup, .bootstrap-wrapper main, .bootstrap-wrapper menu, .bootstrap-wrapper nav, .bootstrap-wrapper section, .bootstrap-wrapper summary{display:block}
.bootstrap-wrapper audio, .bootstrap-wrapper canvas, .bootstrap-wrapper progress, .bootstrap-wrapper video{display:inline-block;vertical-align:baseline}
.bootstrap-wrapper audio:not([controls]){display:none;height:0}
.bootstrap-wrapper [hidden], .bootstrap-wrapper template{display:none}
.bootstrap-wrapper a{background-color:transparent}
.bootstrap-wrapper a:active, .bootstrap-wrapper a:hover{outline:0}
.bootstrap-wrapper abbr[title]{border-bottom:1px dotted}
.bootstrap-wrapper b, .bootstrap-wrapper strong{font-weigh
@onigetoc
onigetoc / How to use Readme.js
Last active July 23, 2016 06:27
readme.js | jQuery Readability plugin | Show web page content with the Readability API
// HOW TO USE
$('#target').readme({
url: readurl,
strip_tags: true, // default true: OPTIONAL
featured_image: true // default true: OPTIONAL
});
// HOW TO USE: SIMPLE
$('#target').readme({ url: readurl});
<!DOCTYPE html>
<html>
<head>
<script src="https://apis.google.com/js/client.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
@onigetoc
onigetoc / controllers.js
Last active February 21, 2016 21:26
Angular Google Contact phone number filter
/*** PHONE FILTER ***/
// .controller('ContactsCtrl', function ($scope, $filter)
.filter('PhoneFilter', function () {
return function (input, search) {
if (!search) {
return input;
}
// USE: <img src="img/placeholderimg.jpg" data-src="http://www.website.com/img/pic_mountain.jpg">
// call function: findimg();
@onigetoc
onigetoc / footer.php
Last active March 1, 2016 18:56
Footer and pagination for Themekraft https://github.com/Themekraft/_tk
@onigetoc
onigetoc / demo.html
Last active March 16, 2016 21:53
Images to Blob & Images to Base64 Angular Directive: Demo https://jsfiddle.net/onigetoc/k8u8v1Lm/
<img src="http://uploads.textchange.ca/avatars/blank_user_icon.jpg" img-base64="https://lh3.googleusercontent.com/-faoV4RDuIHw/AAAAAAAAAAI/AAAAAAAAAuY/wOVIImXv2CQ/photo.jpg?sz=50" />
<img src="http://uploads.textchange.ca/avatars/blank_user_icon.jpg" img-blob="https://www.gravatar.com/avatar/e53a2d1c4d1174acaa0edb5898e533e9/?default=&s=80" />
<img src="http://uploads.textchange.ca/avatars/blank_user_icon.jpg" img-blob="https://www.brokenurlnothing.com/nothing.jpg" />
@onigetoc
onigetoc / services.js
Last active March 11, 2016 20:59
Angular Factory load external json data - DataLoader
.factory('DataLoader', function ($http) {
return {
all: function (url) {
return $http.jsonp(url);
},
get: function (url) {
// Simple index lookup
console.log($http.get(url))
return $http.get(url);
@onigetoc
onigetoc / wp-api-user-meta.php
Last active April 24, 2016 03:44 — forked from scottopolis/wp-api-user-meta.php
Add user meta to the WP-API
<?php
/* Adds all user meta to the /wp-json/wp/v2/user/[id] endpoint */
function sb_user_meta( $data, $field_name, $request ) {
if( $data['id'] ){
$user_meta = get_user_meta( $data['id'] );
}
if ( !$user_meta ) {
return new WP_Error( 'No user meta found', 'No user meta found', array( 'status' => 404 ) );
}