Skip to content

Instantly share code, notes, and snippets.

View taivo's full-sized avatar

Tai Vo taivo

View GitHub Profile
@taivo
taivo / x-editable-radiolist
Last active March 2, 2019 09:23
radiolist support for x-editable
/**
List of radio buttons. Unlike checklist, value is stored internally as
scalar variable instead of array. Extends Checklist to reuse some code.
@class radiolist
@extends checklist
@final
@example
<a href="#" id="options" data-type="radiolist" data-pk="1" data-url="/post" data-title="Select options"></a>
<script>
@taivo
taivo / ion-tabs-swipable.js
Created December 16, 2014 02:37
Swipe navigation for ion-tabs (for ionic framework v 1.0.0)
angular.module('yourModule')
.directive('tabsSwipable', ['$ionicGesture', function($ionicGesture){
//
// make ionTabs swipable. leftswipe -> nextTab, rightswipe -> prevTab
// Usage: just add this as an attribute in the ionTabs tag
// <ion-tabs tabs-swipable> ... </ion-tabs>
//
return {
restrict: 'A',
require: 'ionTabs',
@taivo
taivo / ionic-google-maps-autocomplete-remove-300ms
Last active October 29, 2016 18:14
Remove 300ms delay from google maps autocomplete in ionic framework. Inspired by http://davidwalsh.name/detect-node-insertion . Tested on: Nexus 5 Android, Nexus 7 tablet, and iPhone 6 Safari
//
// CSS - define a keyframe animation called 'nodeInserted'
//
@keyframes nodeInserted {
from { opacity: 0.99; }
to { opacity: 1; }
}
@-webkit-keyframes nodeInserted{
from { opacity: 0.99; }
to { opacity: 1; }
@taivo
taivo / parse-com-anon-auth.js
Last active February 1, 2017 21:32
Anonymous user, anonymous auth with Parse JS SDK
//This is my hackish way to use methods that are already in Parse JS SDK v1.5
//to logIn as an anonymous user. Hackish because it relies on internal methods
//that starts with an underscore and thus subject to change. In any case, it
//helped me move passed authentication and on to the main parts of my project
//and I hope it helps you too.
Parse._getInstallationId().done(
function(installationId){
//
// use installation id because it's already a UUID