Skip to content

Instantly share code, notes, and snippets.

Avatar

Gino onigetoc

View GitHub Profile
View hideAddressbar.js
/**
* 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 / controllers.js
Last active Feb 21, 2016
Angular Google Contact phone number filter
View controllers.js
/*** PHONE FILTER ***/
// .controller('ContactsCtrl', function ($scope, $filter)
.filter('PhoneFilter', function () {
return function (input, search) {
if (!search) {
return input;
}
View Find images data-src to base64 image or blob
// 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 Mar 1, 2016
Footer and pagination for Themekraft https://github.com/Themekraft/_tk
View footer.php
@onigetoc
onigetoc / services.js
Last active Mar 11, 2016
Angular Factory load external json data - DataLoader
View services.js
.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 / demo.html
Last active Mar 16, 2016
Images to Blob & Images to Base64 Angular Directive: Demo https://jsfiddle.net/onigetoc/k8u8v1Lm/
View demo.html
<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" />
View Google Contact Api jQuery
<!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 / wp-api-user-meta.php
Last active Apr 24, 2016 — forked from scottopolis/wp-api-user-meta.php
Add user meta to the WP-API
View wp-api-user-meta.php
<?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 ) );
}
@onigetoc
onigetoc / copyToClipboard.js
Created Jul 17, 2016
Copy to clipboard Javascript - copyToClipboard
View copyToClipboard.js
// copy to clip board
$("#copy").click(function() {
copyToClipboard('#allContent');
});
function copyToClipboard(element) {
var $temp = $("<textarea>");
$("body").append($temp);
$temp.val($(element).html()).select();