Skip to content

Instantly share code, notes, and snippets.

View beshkenadze's full-sized avatar

Aleksandr Beshkenadze beshkenadze

View GitHub Profile
@beshkenadze
beshkenadze / uri.js
Created September 6, 2012 12:40 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@beshkenadze
beshkenadze / README.markdown
Created October 8, 2012 13:59 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@beshkenadze
beshkenadze / CheatSheet.java
Created November 2, 2012 12:31 — forked from romannurik/CheatSheet.java
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@beshkenadze
beshkenadze / gist:4152635
Created November 27, 2012 06:03 — forked from vena/gist:2856490
Netatalk 3.0 beta installation procedure (Ubuntu 12.04)

Install prerequisites:

$ sudo apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev

Download src:

$ cd /usr/local/src
$ git clone git://netatalk.git.sourceforge.net/gitroot/netatalk/netatalk
$ cd netatalk

$ ./bootstrap

@beshkenadze
beshkenadze / 1_netatalk-3-install-on-debian-7
Last active October 13, 2015 13:38 — forked from vena/gist:2856490
Netatalk 3 installation procedure (Ubuntu 12.04.2 LTS/Debian 7)
$ tar xvf netatalk-3.0.5.tar.bz2
$ cd netatalk-3.0.5
$ ./configure \
--with-init-style=debian \
--with-cracklib \
--without-libevent \
--with-pam-confdir=/etc/pam.d \
--with-dbus-sysconf-dir=/etc/dbus-1/system.d
$ checkinstall --pkgname=netatalk-3.x --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no
@beshkenadze
beshkenadze / afp.conf
Created December 5, 2012 21:00 — forked from oscarcck/afp.conf
afp.conf sample for osx 10.7 lion time machine with netatalk 3.0 afpd on ubuntu 12.04
;
; Netatalk 3.x configuration file
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
;
[Global]
; Global server settings
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so
/** Volley request parsing JSON strings using the gson deserializer */
public class GsonRequest<T> extends Request<T> {
/** Type of Generic. */
private final Class<T> mTypeOfT;
/** Response listener */
private final Response.Listener<T> mListener;
/** GSON parser */
private final Gson mGson;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.gcm.GoogleCloudMessaging;
signing.debug.storePassword=myPassword
signing.debug.keyAlias=androiddebugkey
signing.debug.keyPassword=myPassword
signing.release.storePassword=myReleasePassword
signing.release.keyAlias=androidreleasekey
signing.release.keyPassword=myReleasePassword
deploygate.userName=myUserName
deploygate.token=myToken
// add method to get the versionCode from cli param
// eg. `gradle tasks -PversionCode=999`
/**
* Get the version code from command line param
*
* @return int If the param -PversionCode is present then return int value or -1
*/
def getVersionCode = { ->