Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Alashov Berkeli alashow

🏠
Working from home
View GitHub Profile
View DateUtil.java
/*
* Copyright 2014. Alashov Berkeli
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@alashow
alashow / PrettyIntegers.java
Last active Oct 1, 2016
Convert long integers to "pretty" strings. Could be used for ids in pretty urls
View PrettyIntegers.java
package tm.alashow.playground;
public class PrettyIntegers {
public static void main( String args[] ) {
Character[] map = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K',
'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't',
'u', 'v', 'x', 'y', 'z', '1', '2', '3'};
View do-i-wanna-know_TM.txt
Ýaňagyňda reňkler barmy?
Gymyldap bilmejek derejede gorky gördüňmi?
Dişiňde galan zat ýaly, hiç ýere gitmeýän?
Mümkin sende maňa aýdarlyk zadyň bardyr?
Ýüregimde doly ornaşanyňy bileňokdyňmy?
Şu hepde sen barada her gije pikirlendim
Syrlary saklap bilýäňmi?
Umuman, näme üçündir seni ýadyma salýan aýdym tapdym
We men ony ýatyp galýançam gaýta-gaýta diňleýän
Içgilerimi düşegime döküp
@alashow
alashow / OkHttp3Stack.java
Last active May 29, 2020 — forked from bryanstern/OkHttpStack.java
An OkHttp backed HttpStack for Volley (okhttp3 version)
View OkHttp3Stack.java
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
View Mover.java
package mover;
import java.io.File;
import java.nio.file.Files;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Moves files to folders with name founded year (4 length number in parenthesis) in file name. Can be used for ordering movie files
* Ex.: file name: The Bourne Identity (2002).mp4
@alashow
alashow / user.js
Last active Mar 19, 2018
Force tumblr posts use hight quality images. Tempermonkey user script.
View user.js
// ==UserScript==
// @name Tumblr image size converter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Force tumblr post photos use high quality
// @author Alashov Berkeli
// @include https://www.tumblr.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
// @grant none
// ==/UserScript==
@alashow
alashow / haproxy.cfg
Created Sep 11, 2016 — forked from T0MM0R/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
View haproxy.cfg
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
View ImageUtils.java
/*
* Copyright (c) 2016 Alashov Berkeli
* It is licensed under GNU GPL v. 2 or later. For full terms see the file LICENSE.
*/
package tm.asmanoky.aziada.util.glide;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
View U.java
/**
* Part of my utils class that I use in my apps.
* Contains only functions related to showing snackbars and toasts.
* Some string/resources are missing in this gist. Names of resources are self explanatory. Hence, it shouldn't be hard to define it in your resources.
*/
public class U {
public static float density = 1;
public static final int SNACK_DEFAULT = 0;
View fix_permissions.sh
# run in "root" folder (e.g /home/datmusic/api.datmusic.xyz/)
chown -R datmusic:www-data storage .env
find storage -type f -exec chmod 664 {} \;
find storage -type d -exec chmod 775 {} \;
chgrp -R www-data storage .env
chmod -R ug+rwx storage .env