Skip to content

Instantly share code, notes, and snippets.

Avatar

Lukasz Piliszczuk lukaspili

View GitHub Profile
View step 1: get token
+ (void)getToken:(void (^)(NSString*))completionBlock;
{
ADAuthenticationError *error = nil;
authContext = [ADAuthenticationContext authenticationContextWithAuthority:@"https://login.microsoftonline.com/common"
error:&error];
[authContext acquireTokenWithResource:@"https://graph.windows.net"
clientId:@"<Your Client ID>" // Comes from App Portal
redirectUri:[NSURL URLWithString:@"<Your Redirect URI>"] // Comes from App Portal
completionBlock:^(ADAuthenticationResult *result)
View audio_api.js
import client from './client'
export default {
loadList(page) {
console.log(`load audio books [page ${page}]`)
return client.get(`audio`, { page: page, per_page: 25 })
.then(response => {
console.log(`load audio books success: [${response.data.books.length}]`);
return Promise.resolve(response.data.books)
View etc-hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
#127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
View ScrollableViewController.swift
import UIKit
import SnapKit
class ScrollableViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.whiteColor()
let scrollView = UIScrollView()
View FadingScrollView.m
//
// YMMFadingScrollView.m
// Youmiam
//
// Created by Lukas on 4/14/14.
// Copyright (c) 2014 Siu. All rights reserved.
//
#import "YMMFadingScrollView.h"
View konsent
PUT https://www.konsent.io/api/project/associate
params:
- application build number
RESPONSE:
- 200:
{
build_features: [ ... ],
other_features: [ ... ]
}
View font.kt
package com.siu.android.univelo.paris.ui.view.util
import android.content.res.AssetManager
import android.graphics.Typeface
import android.view.View
import java.util.*
/**
* @author Lukasz Piliszczuk - lukasz.pili@gmail.com
*/
@lukaspili
lukaspili / View.java
Created Oct 20, 2015
Kotlin + Anko beauty on Android
View View.java
package lukaspili.angelus.mvp.home.drawer
import android.content.Context
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import architect.MortarFactory
import architect.Screen
View gist:2c9fac50d409280721a5
public class SimpleView extends LinearLayout {
@Inject
SimpleScreen.Presenter presenter;
public SimpleView(Context context, AttributeSet attrs) {
super(context, attrs);
DaggerService.<SimpleScreen.Component>getDaggerComponent(context)
.inject(this);
}
View gist:a85175fe529950d48941
public class SimpleScreen {
@dagger.Component(dependencies = SimpleMortarActivity.Component.class)
@CustomScope(Component.class)
public static interface Component
extends SimpleMortarActivity.Component {
void inject(SimpleView view);
}