Skip to content

Instantly share code, notes, and snippets.

View mr5z's full-sized avatar
🎯
Focusing

mark mr5z

🎯
Focusing
View GitHub Profile
This file has been truncated, but you can view the full file.
<html>
<head>
<title>JSF*ck Screen Saver</title>
</head>
<body>
<h1>Hello World!</h1>
<script>
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]
@Override
public void onTaskEnd(PagedResult<List<Product>> result) {
if (result.isSuccess()) { // isSuccess guarantees result.data is not null
products.clear();
products.addAll(result.data); // AS warns me that result.data might be null
adapter.notifyDataSetChanged();
}
setRefreshing(false);
}
@mr5z
mr5z / listactivity.java
Created May 8, 2018 16:43
what is happening?
class BaseActivity : AppCompatActivity {
void setTitleX(CharSequence title) {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(title);
}
}
}
class ListActivity : BaseActivity {
public static IEnumerable<PositionData> ScalePolygon(IEnumerable<PositionData> points, double scaleFactor)
{
var center = GetCentralGeoCoordinate(points.ToList());
var normalizePoints = points.Select(p => new PositionData(
p.Latitude - center.Latitude, p.Longitude - center.Longitude));
var scaledPoints = normalizePoints.Select(p => new PositionData(
p.Latitude * scaleFactor, p.Longitude * scaleFactor));
return scaledPoints.Select(p => new PositionData(p.Latitude + center.Latitude, p.Longitude + center.Longitude));
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polygon</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polygon</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
public static IEnumerable<PositionData> ScalePolygonByMeter(IEnumerable<PositionData> points, double meterScale)
{
meterScale = MeterToDecimalDegree(meterScale);
var center = GetCentralGeoCoordinate(points.ToList());
var normalizePoints = points.Select(p => new PositionData(
p.Latitude - center.Latitude, p.Longitude - center.Longitude));
var scaledPoints = normalizePoints.Select(p => new PositionData(
p.Latitude + p.Latitude * meterScale, p.Longitude + p.Longitude * meterScale));
return scaledPoints.Select(p => new PositionData(p.Latitude + center.Latitude, p.Longitude + center.Longitude));
}
class ActionWithPriority
{
public int Priority { get; set; }
public Action Action { get; set; }
}
var actions = new List<ActionWithPriority>
{
MakeAction(() => Console.WriteLine("Hi"), 3),
MakeAction(() => Console.WriteLine("Hello"), 2),
@mr5z
mr5z / qa.cs
Created November 14, 2018 04:48
class QuestionAndAnswers
{
string _preliminaryQuestion;
public string PreliminaryQuestion {
get => Parameters != null ? string.Format(_preliminaryQuestion, Parameters) : _preliminaryQuestion;
set => _preliminaryQuestion = value;
}
string _repeatedQuestion;
public string RepeatedQuestion {
var data = @"
Interrogation: {
Id: 0,
Question: 'How are you?',
PossibleAnswers: [
{
Text: 'I'm okay',
Polarity = Polarity.Positive,
Interrogation: {
{