Skip to content

Instantly share code, notes, and snippets.

SelvinPL SelvinPL

Block or report user

Report or block SelvinPL

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BuildConstant.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupBuildInfoProperty" BeforeTargets="CoreCompile">
<ItemGroup>
<BuildInfoProperty Include="Configuration"/>
<BuildInfoProperty Include="ProjectDir"/>
</ItemGroup>
</Target>
<Target Name="GenereteBuildInfo" BeforeTargets="CoreCompile" >
@SelvinPL
SelvinPL / ISomeAction.java
Last active Jul 24, 2018
Terrible and stupid idea of passing Activity via Bundle
View ISomeAction.java
package pl.selvin.terribleidea;
import java.io.Serializable;
public interface ISomeAction extends Serializable {
String KEY = "interface";
void sendAddress(String address);
}
@SelvinPL
SelvinPL / main.dart
Created Apr 13, 2018
Popular Movies in Dart/Flutter
View main.dart
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
class MyTheme {
@SelvinPL
SelvinPL / DoNotDoThisBecauseItsStupid.java
Last active Jun 27, 2017
Of course it will not work when Dev Options->Don't Keep Activitie is on
View DoNotDoThisBecauseItsStupid.java
package pl.selvin.completelywrongsolution;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
View TestFragment.java
public class TestFragment extends DialogFragment {
private static final String INNER_TAG = "TEST_INNER_TAG";
InnerFragment inner = null;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
View test.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* 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
View build.gradle
apply plugin: 'com.android.application'
apply from: 'themes.gradle'
def colorDisabled = 0xADADAD
android {
....
productFlavors.whenObjectAdded { flavor ->
themes_createExtension(flavor, 0x244124, 0x0B280B, 0x3D5A3D, 0x92bc00, colorDisabled)
}
....
View test.java
static volatile boolean isRunning = true;
void test() {
final int SIZE = 16 * 1024;
try {
final PipedOutputStream pipedOutputStream = new PipedOutputStream();
final PipedInputStream pipedInputStream = new PipedInputStream(SIZE);
pipedOutputStream.connect(pipedInputStream);
final Object wait = new Object();
new Thread(new Runnable() {
@Override
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example" >
<application
<!-- other Activities goes here -->
<activity
android:name=".ProxyActivity"
android:label="Some nice label"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
You can’t perform that action at this time.