This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.irfan.rest; | |
import org.springframework.boot.actuate.health.HealthEndpoint; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Secure workaround for https://issues.sonatype.org/browse/MVNCENTRAL-1369 | |
# Navigate to the root of your Spring Boot project where a Maven wrapper is present and run this script | |
cd .mvn/wrapper | |
wget https://gist.githubusercontent.com/kbastani/d4b4c92969ec5a22681bb3daa4a80343/raw/f166086ef051369383b02dfb74317cd07b6f2c6e/settings.xml | |
cd ../../ | |
./mvnw clean install -s .mvn/wrapper/settings.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Expand | |
const sectionEl = document.querySelector("section[data-purpose='sidebar']"); const checkboxes = sectionEl.querySelectorAll("input[type='checkbox']"); checkboxes.forEach((checkbox) => { if (!checkbox.checked) { checkbox.disabled = false; checkbox.click(); } }); | |
## Mark as Complete | |
const checkboxes = document.querySelectorAll("input[type='checkbox']"); | |
checkboxes.forEach((checkbox) => { | |
if(!checkbox.checked) { | |
checkbox.click();}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find add 'node_modules' | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# Delete all | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Automatically adds branch name and branch description to every commit message. | |
# Modified from the gist here https://gist.github.com/bartoszmajsak/1396344 | |
# | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
RED="\033[1;31m" | |
GREEN="\033[1;32m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://github.com/Ortanon/mongo | |
docker pull karimtemple/mongo | |
mkdir db && sudo chmod 777 db | |
docker run --platform linux/amd64 --name mongodb --rm -d -p 27017:27017 --user 202:202 -v $(pwd)/db:/data/db karimtemple/mongo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.getCollection("your_collection").find( | |
{ | |
"start_time": { "$lte": 900 }, // time stored as int | |
"end_time": { "$gte": 479 } | |
}, | |
{ | |
"start_time": 1, "end_time": 1 // projection | |
} | |
) | |
// credits https://stackoverflow.com/questions/26876803/mongodb-find-date-range-if-overlap-with-other-dates/26877645 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { gregorianToJulian, julianToHijri } from './hijri-util-date.js'; | |
/** | |
* Gregorian to Hijri | |
* * First convert to Julian | |
* * then convert to hijri | |
*/ | |
const futureDate = dayjs('2019-10-24').add(1, 'year'); | |
// .format('YYYY-MM-DD'); | |
const y = futureDate.year(); | |
const d = futureDate.day(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/widgets.dart'; | |
// from below link | |
// https://github.com/dancamdev/effectively_scale_UI_according_to_different_screen_sizes/blob/master/lib/SizeConfig.dart | |
class SizeConfig { | |
static MediaQueryData _mediaQueryData; | |
static double screenWidth; | |
static double screenHeight; | |
static double blockSizeHorizontal; | |
static double blockSizeVertical; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# subl /usr/local/etc/php/7.3/conf.d/ext-xdebug.ini | |
[xdebug] | |
xdebug.mode = debug | |
xdebug.max_nesting_level = 1000 | |
xdebug.start_with_request=yes | |
xdebug.client_port=9090 | |
xdebug.client_host=127.0.0.1 | |
xdebug.discover_client_host=1 | |
xdebug.idekey=PHPSTORM |
NewerOlder