Skip to content

Instantly share code, notes, and snippets.

View mmanishh's full-sized avatar
🎯
Focusing

manish maharjan mmanishh

🎯
Focusing
View GitHub Profile
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active March 11, 2024 19:25
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@ashokpant
ashokpant / nepali_stopwords.txt
Last active May 24, 2019 03:39
List of Nepali stopwords
अझै
अधिक
अन्य
अन्यत्र
अन्यथा
अब
अरु
अरुलाई
अर्को
अर्थात
@ossanna16
ossanna16 / Beginner-friendly Python Open Source Projects
Last active February 5, 2024 09:46
This is a list of beginner-friendly Python open source projects. I'm always looking for new projects to add to my list, if you have an idea please tweet me at @ossanna16 :)
* OpenHatch - https://openhatch.org/search/?q=&language=Python
* PyLadies - https://github.com/pyladies
* New Coder - https://github.com/econchick/new-coder
* Django Girls - https://github.com/DjangoGirls
* Matplotlib - https://github.com/matplotlib/matplotlib
* Hylang - http://docs.hylang.org/en/latest/, https://github.com/hylang/hy
* Open Slides (Django) - http://openslides.org/
* Zeeguu - https://zeeguu.unibe.ch
* Project Jupyter - https://github.com/jupyter
* nbgrader - https://github.com/jupyter/nbgrader
@ssinss
ssinss / EndlessRecyclerOnScrollListener.java
Last active January 19, 2024 08:52
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@vool
vool / debian_setup.md
Last active June 19, 2020 15:24
Debain standard setup

Debain setup

Default set up for git deploy web-server on debian box [for a laravel site but also pretty generic]

There a good guide (for ubuntu) here

Update and install

apt-get update && apt-get upgrade

@wasabeef
wasabeef / AnimatedGifEncoder.java
Last active July 8, 2023 10:04
Android - AnimatedGifEncoder
import java.io.IOException;
import java.io.OutputStream;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Paint;
public class AnimatedGifEncoder {
protected int width; // image size
@ryanbateman
ryanbateman / gist:6667995
Last active September 6, 2017 21:03
Basic BlurTransformer for Square's Picasso
import android.content.Context;
import android.graphics.Bitmap;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
public class BlurTransform implements Transformation {
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@granoeste
granoeste / EachDirectoryPath.md
Last active March 17, 2024 03:15
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@hrldcpr
hrldcpr / tree.md
Last active March 27, 2024 14:40
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!