Skip to content

Instantly share code, notes, and snippets.

View ariedov's full-sized avatar
🇺🇦

David Leibovych ariedov

🇺🇦
View GitHub Profile
@ariedov
ariedov / ReadAttr.java
Created October 25, 2018 13:53
Restrict attribute to it's type
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 October 11, 2018 15:33
Scrollable cards
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 September 12, 2018 08:23
The Tale. Help until has energy.
setInterval(function() {
energy = parseInt($(".pgf-energy").text())
if (energy >= 2000) {
$(".pgf-ability-help").click()
}
}, 1000);
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 {
@ariedov
ariedov / jsfiddle
Created December 6, 2013 16:50
JSFiddle in browser
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>
https://github.com/users/ariedov/contributions_calendar_data?_=0
@ariedov
ariedov / build.gradle
Created November 19, 2013 16:36
Gradle android project build config.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6+'
}
}
@ariedov
ariedov / colors.xml
Last active December 25, 2015 10:39
w3c android colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="yellow">#FFFF00</color>
<color name="fuchsia">#FF00FF</color>
<color name="red">#FF0000</color>
<color name="silver">#C0C0C0</color>
<color name="gray">#808080</color>
<color name="olive">#808000</color>
<color name="purple">#800080</color>
@ariedov
ariedov / gist:5016065
Created February 22, 2013 19:49
Read an integer from console.
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(bufferRead.readLine().trim());
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`