Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Truly Mittal trulymittal

🏠
Working from home
View GitHub Profile
@trulymittal
trulymittal / tailwind-colors.js
Last active Jun 5, 2021
List of all default Tailwind CSS colors from the default theme
View tailwind-colors.js
export const colors = {
black: '#000',
white: '#fff',
rose: {
'50': '#fff1f2',
'100': '#ffe4e6',
'200': '#fecdd3',
'300': '#fda4af',
'400': '#fb7185',
'500': '#f43f5e',
@trulymittal
trulymittal / CODE-REVIEW.md
Last active Mar 21, 2021
Rules for submitting your repo to be reviewed on the YouTube channel - yoursTruly
View CODE-REVIEW.md

How to submit the Repo?

Fun Fact: 🤓

You can completely ignore what I say or comment or review or the rating I provide. I only speak what I think is best according to me. There is no rule of thumb. Even what I say in review might be completely wrong in your context but I will try my best. And secondly, don't be put off by my critical comments.

What can you submit?

  • Android apps (java/kotlin)
@trulymittal
trulymittal / google-drive-api.js
Last active Nov 30, 2021
Gist to demonstrate Google Drive API using NodeJs
View google-drive-api.js
/*
Google Drive API:
Demonstration to:
1. upload
2. delete
3. create public URL of a file.
required npm package: googleapis
*/
const { google } = require('googleapis');
@trulymittal
trulymittal / axios-interceptors-refresh-token.js
Created Jul 4, 2020 — forked from mkjiau/axios-interceptors-refresh-token.js
Axios interceptors for token refreshing and more than 2 async requests available
View axios-interceptors-refresh-token.js
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
View Check Network Android.md

Checking Network connection in android

Step 1: Add this to AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Step 2: Create this method where ever you like and use the result

View sendmail.java
public void sendmail() {
String[] TO_EMAILS = {"emailone@example.com", "emailtwo@example.com"};
String[] CC = {"emailthree@example.com"};
String[] BCC = {"emailfour@example.com"};
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:"));
intent.putExtra(Intent.EXTRA_EMAIL, TO_EMAILS);
intent.putExtra(Intent.EXTRA_CC, CC);
View Nginx Container.md

Running Nginx container using Docker

To start setting up Nginx container

Step 1: Pull the latest image from docker hub (https://hub.docker.com)

docker pull nginx
@trulymittal
trulymittal / docker-compose.yaml
Created Aug 6, 2019
Docker Compose file for Wordpress setup
View docker-compose.yaml
version: "3"
services:
#Database service
mysql_db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: some_password_of_ur_choice
MYSQL_DATABASE: name_your_wordpress_database
@trulymittal
trulymittal / .htaccess
Last active Apr 13, 2021
.htaccess file to be used with Docker Compose for Wordpress setup, if you want to change php limits.
View .htaccess
# BEGIN WordPress
php_value memory_limit 256M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
# END WordPress