Skip to content

Instantly share code, notes, and snippets.

View chankruze's full-sized avatar
🎯
Focusing

Chandan Kumar Mandal chankruze

🎯
Focusing
View GitHub Profile
@chankruze
chankruze / gist:66494de8d052408b1f5d18b7add292c8
Created June 18, 2019 17:04 — forked from yqritc/gist:ccca77dc42f2364777e1
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
android:toDegrees="360">
<shape android:shape="ring" android:innerRadiusRatio="3"
android:thicknessRatio="8" android:useLevel="false">
<size android:width="56dip" android:height="56dip" />
<gradient android:type="sweep" android:useLevel="false"
@chankruze
chankruze / insert_node_beginning.c
Created June 2, 2019 18:26
Linked List Implementation
// Linked List: Insert a node at beginning
/*
* @Author: chankruze (Chandan Kumar Mandal)
* @Date: 2019-06-02 21:40:46
* @Last Modified by: chankruze (Chandan Kumar Mandal)
* @Last Modified time: 2019-06-02 23:54:36
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
void swap(int *, int *); // The right way is to declare function prototype in header.
int main()
{
int a, b;
// printf("Enter the value of a:\n");
// scanf("%d", &a);
@chankruze
chankruze / README.md
Created May 29, 2019 21:12 — forked from saenzramiro/README.md
CI with Travis, github Releases API, gh-pages and npm publish

CI with Travis, GitHub Releases API and gh-pages

When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.

The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.

Organize your project

Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.

@chankruze
chankruze / test
Created May 28, 2019 18:22
test: A custom shell binary to compile and run a C source file to quickly test code snippets
FILE_NAME=$(basename $1 .c)
gcc $1 -o $FILE_NAME && chmod a+x $FILE_NAME && ./$FILE_NAME
chankruze@geekofia:~/Android/Sdk/platform-tools$ adb version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5
Installed as /usr/lib/android-sdk/platform-tools/adb

chankruze@geekofia:~/Android/Sdk/platform-tools$ ./adb version
Android Debug Bridge version 1.0.40
Version 28.0.2-5303910
Installed as /home/chankruze/Android/Sdk/platform-tools/adb

File Permissions

sudo mv inc/config.default.php inc/config.php
sudo chmod 666 inc/config.php inc/settings.php
chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/

optional

git tag -l | xargs -n 1 git push --delete origin
git tag | xargs git tag -d
  • Create project django-admin startproject <project_name>

  • Create application

cd <project_dircetory>
python manage.py startapp <app_name>
  • Create view