Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Smarteist smarteist

💭
I may be slow to respond.
  • Azerbaijan Baku
Block or report user

Report or block smarteist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@smarteist
smarteist / LocaleHelper.java
Created Dec 9, 2018
Android Locale Changer
View LocaleHelper.java
package com.rayana.himeapp.Utility;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.LocaleList;
import android.preference.PreferenceManager;
View utils.php
<?php
class utils
{
public static function get_request_headers()
{
$headers = array();
@smarteist
smarteist / xdebug-mac.md
Created Mar 31, 2019 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2018
View xdebug-mac.md

🐞 Install and Configure xDebug on MacOS for PhpStorm 🐘

⚠️ This guide only applies to Homebrew v1.6+

  • Check your version brew --version before proceeding

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache
@smarteist
smarteist / install_postman.sh
Last active Apr 29, 2019
Postman 7 Installation SH commands for ubuntu
View install_postman.sh
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
sudo apt-get -y install libgconf2-4
sudo apt-get -y install libcanberra-gtk-module
sudo apt-get -y install libcanberra-gtk-module:i386
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
@smarteist
smarteist / DiffUtilCallback
Last active May 24, 2019
It's more simple callback for calculating the diff between two non-null items in a list.
View DiffUtilCallback
/**
* It's more simple callback for calculating the diff between two non-null items in a list.
* <p>
* {@link DiffUtil.Callback} serves two roles - list indexing, and item diffing. ItemCallback handles
* just the second of these, which allows separation of code that indexes into an array or List
* from the presentation-layer and content specific diffing code.
*
* @param <T> Type of items to compare.
*/
public abstract class DiffUtilCallback<T> extends DiffUtil.Callback {
@smarteist
smarteist / InfiniteScrollProvider.java
Last active May 27, 2019
Android recyclerView Infinite Scrolling (Endless Scrolling)
View InfiniteScrollProvider.java
package com.nodano.memo.utils.AppUtils;
import androidx.annotation.NonNull;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import android.content.res.Resources;
@smarteist
smarteist / DiffUtilCallback.java
Created May 27, 2019
It's more simple callback for calculating the diff between two non-null items in a list.
View DiffUtilCallback.java
/**
* It's more simple callback for calculating the diff between two non-null items in a list.
* <p>
* {@link DiffUtil.Callback} serves two roles - list indexing, and item diffing. ItemCallback handles
* just the second of these, which allows separation of code that indexes into an array or List
* from the presentation-layer and content specific diffing code.
*
* @param <T> Type of items to compare.
*/
View Webpack configs.txt
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: "development",
entry: ['./index.js', './scss/main.scss', './css/plain_css.css'],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'js/bundle.js'
},
You can’t perform that action at this time.