Skip to content

Instantly share code, notes, and snippets.

public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
/*
* Copyright 2014 Chris Banes
*
* 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
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
menu = new MenuWrapper(menu) {
private MenuItem fix(MenuItem item) {
try {
Field f = item.getClass().getDeclaredField("mEmulateProviderVisibilityOverride");
f.setAccessible(true);
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@scan
scan / mp3.js
Created August 21, 2014 06:44 — forked from dtrce/mp3.js
var http = require('http'),
fileSystem = require('fs'),
path = require('path')
util = require('util');
http.createServer(function(request, response) {
var filePath = 'path_to_file.mp3';
var stat = fileSystem.statSync(filePath);
response.writeHead(200, {
@scan
scan / crop.js
Created November 6, 2013 07:14 — forked from arian/crop.js
var spawn = require('child_process').spawn;
var Stream = require('stream');
/**
* crops and resizes images to our desired size
* @param {Stream} streamIn in stream containing the raw image
* @return {Stream}
*/
exports.cropImage = function(streamIn){
@scan
scan / KV.hs
Last active December 20, 2015 07:49 — forked from LeviSchuck/KV.hs
{-# LANGUAGE RecordWildCards, MultiParamTypeClasses, FlexibleInstances #-}
class KVEntity a b where
kvIdentity :: a -> KVIdentifier
kvProperties :: a -> Value
kvLastModified :: a -> UTCTime
kvClass :: a -> KVClass
kvRelations :: a -> [KVLink]
kvCachedRels :: a -> [b]
@scan
scan / OAuth2.hs
Created July 13, 2013 15:19 — forked from qzchenwl/OAuth2.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
@scan
scan / OAuth2.hs
Created July 10, 2013 07:05 — forked from qzchenwl/OAuth2.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
$ ->
($ '#login-btn').click ->
navigator.id.request
siteName: 'neighr'
#siteLogo: '/logo.png'
false
($ '#logout-btn').click ->
navigator.id.logout()
false