Skip to content

Instantly share code, notes, and snippets.

View ariedov's full-sized avatar
🇺🇦

David Leibovych ariedov

🇺🇦
View GitHub Profile
#EXTM3U
#EXTINF:-1,Sintel
https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
@ariedov
ariedov / main.py
Created June 8, 2024 08:37
Simple python game "Guess the number"
import random
rand = random.randint(0, 10)
print(f"Я загадав число!")
while True:
guess = int(input("Вгадуй!"))
print(f"Ти вважаєш що {guess}?")
if guess == rand:
print("Вгадав!")
@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 / Tree.java
Created November 10, 2015 14:21
Binary tree
class Tree {
Holder initial;
add(int value) {
Holder object = initial;
addToHolder(object);
}
private addToHolder(Holder object, int value) {
git checkout master
git merge --squash bugfix
git commit
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 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>