Skip to content

Instantly share code, notes, and snippets.

@ariedov
ariedov / ReadAttr.java
Created Oct 25, 2018
Restrict attribute to it's type
View ReadAttr.java
TypedArray ta = getActivity().obtainStyledAttributes(R.styleable.LeanbackTheme);
mContainerListMarginStart = (int) ta.getDimension(
R.styleable.LeanbackTheme_browseRowsMarginStart, getActivity().getResources()
.getDimensionPixelSize(R.dimen.lb_browse_rows_margin_start));
mContainerListAlignTop = (int) ta.getDimension(
R.styleable.LeanbackTheme_browseRowsMarginTop, getActivity().getResources()
.getDimensionPixelSize(R.dimen.lb_browse_rows_margin_top));
ta.recycle();
@ariedov
ariedov / main.dart
Last active Oct 11, 2018
Scrollable cards
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
const CARD_SIZE = const Size(172.0 * 1.6, 248.0 * 1.6);
const SEPARATOR_WIDTH = 10.0;
const WIDTH_DIFFERENCE = 30.0;
const ITEM_COUNT = 80;
class MyApp extends StatelessWidget {
@ariedov
ariedov / thetale.js
Created Sep 12, 2018
The Tale. Help until has energy.
View thetale.js
setInterval(function() {
energy = parseInt($(".pgf-energy").text())
if (energy >= 2000) {
$(".pgf-ability-help").click()
}
}, 1000);
View Getmanstudio nginx config
upstream getmanstudio_server {
server unix:/home/david/getman-studio-django/run/gunicorn.sock fail_timeout=0;
}
upstream getmanstudiodev_server {
server unix:/home/david/getman-studio-dev/run/gunicorn.sock fail_timeout=0;
}
server {
View Tree.java
class Tree {
Holder initial;
add(int value) {
Holder object = initial;
addToHolder(object);
}
private addToHolder(Holder object, int value) {
View git merge squash
git checkout master
git merge --squash bugfix
git commit
View Pretty git log
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@ariedov
ariedov / jsfiddle
Created Dec 6, 2013
JSFiddle in browser
View jsfiddle
data:text/html,%20<x%20id=e><script>for(i=4;i--;)e.innerHTML+=(i?'<textarea%20id=t'+i:'<iframe')+'%20style=width:49%;height:48%%20oninput=\'e.lastChild.src="data:text/html;base64,"+btoa(t3[v="value"]+"<script>"+t1[v]+"<\/script><style>"+t2[v])\'>'</script>
View Github contributions history.
https://github.com/users/ariedov/contributions_calendar_data?_=0
@ariedov
ariedov / build.gradle
Created Nov 19, 2013
Gradle android project build config.
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6+'
}
}