Skip to content

Instantly share code, notes, and snippets.

View ilyasKerbal's full-sized avatar

ILYAS KERBAL ilyasKerbal

View GitHub Profile
@ilyasKerbal
ilyasKerbal / Fit Layer To Canvas.jsx
Created August 16, 2017 13:45 — forked from jawinn/Fit Layer To Canvas.jsx
Fit Layer To Canvas - Photoshop Script
// FIT LAYER TO CANVAS
// via https://forums.adobe.com/message/5413957#5413957
var maintainAspectRatio;// set to true to keep aspect ratio
if(app.documents.length>0){
app.activeDocument.suspendHistory ('Fit Layer to Canvas', 'FitLayerToCanvas('+maintainAspectRatio+')');
}
function FitLayerToCanvas( keepAspect ){// keepAspect:Boolean - optional. Default to false
var doc = app.activeDocument;
var layer = doc.activeLayer;
// do nothing if layer is background or locked
@ilyasKerbal
ilyasKerbal / horizontal_progress_demo.xml
Created August 17, 2017 11:50 — forked from Antarix/horizontal_progress_demo.xml
Android Custom horizontal ProgressBar emample
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progress_limit"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ilyasKerbal
ilyasKerbal / InstallingMeld
Created September 21, 2017 12:34 — forked from kjlubick/InstallingMeld
How to install Meld on Windows and getting it set up with Git
After installing it http://sourceforge.net/projects/meld-installer/
I had to tell git where it was:
git config --global merge.tool meld
git config --global diff.tool meld
git config --global mergetool.meld.path “C:\Program Files (x86)\Meld\meld\meld.exe”
And that seems to work. Both merging and diffing with “git difftool” or “git mergetool”
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#000000</color>
<color name="white">#FFFFFF</color>
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
<color name="red_300">#E57373</color>
@ilyasKerbal
ilyasKerbal / _decimal.scss
Created March 13, 2020 18:37 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@ilyasKerbal
ilyasKerbal / config.js
Created April 13, 2020 15:26 — forked from codediodeio/config.js
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@ilyasKerbal
ilyasKerbal / request-picture-in-picture.js
Created May 21, 2020 12:33 — forked from iamandrewluca/request-picture-in-picture.js
Request picture in picture on first found video that is playing #bookmarklet
javascript: void ((function() {
/** @type {NodeListOf<HTMLIFrameElement>} */
const iFrames = window.document.querySelectorAll('iframe');
/** @type {Document[]} */
const allDocuments = [
window.document,
...Array.from(iFrames)
.map(i => i.contentDocument)
/**
@ilyasKerbal
ilyasKerbal / .procmailrc
Created November 26, 2021 18:59 — forked from leifdenby/.procmailrc
Forwarding emails to a Python script with procmail
:0Wc:
| env python mail_receiver.py
@ilyasKerbal
ilyasKerbal / gist:7711351458959b5ddb189a582a6d79b1
Created March 28, 2022 19:33 — forked from appoll/gist:d863a09f25076061e881
Working sample of fragment inside CoordinatorLayout
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
@ilyasKerbal
ilyasKerbal / NetworkException.java
Created July 28, 2022 10:47 — forked from naturalwarren/NetworkException.java
Retrofit 2 CallAdapterFactory that Wraps Network Errors
package com.uber.retrofit2.adapters.network.exception;
import android.support.annotation.NonNull;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Request;