Skip to content

Instantly share code, notes, and snippets.

View armankara's full-sized avatar
💭
Play game

Arman Kara armankara

💭
Play game
View GitHub Profile
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active April 15, 2024 14:39
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@mircobabini
mircobabini / Angular.Ionic.HardwareBackButtonManager.js
Last active November 8, 2018 08:44
HardwareBackButtonManager Service for Ionic (Angular.js) provides an interface to easily enable or disable the hardware back button on Android
.service( 'HardwareBackButtonManager', function($ionicPlatform){
this.deregister = undefined;
this.disable = function(){
this.deregister = $ionicPlatform.registerBackButtonAction(function(e){
e.preventDefault();
return false;
}, 101);
}
@evantahler
evantahler / example.js
Created June 1, 2012 12:31
PhoneGap / Cordova Device Token plugin JS component (iOs)
// An example of how to use the PhoneGap / Cordova plugin described in this post [[ http://blog.evantahler.com/phonegap-and-push-notifications ]] to get an iOs device token
document.addEventListener("deviceready", function(){
getDeviceToken();
}
getDeviceToken = function(){
if(typeof device != "undefined" && typeof cordova == "object"){
var getToken = function(types, success, fail){
cordova.exec(success, fail, "PushToken", "getToken", types);
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];