Skip to content

Instantly share code, notes, and snippets.

View mostafa8026's full-sized avatar
🎯
Focusing

Mostafa mostafa8026

🎯
Focusing
View GitHub Profile
@anchan828
anchan828 / README.md
Last active July 22, 2024 10:33
This is an improvement to allow @nestjs/[email protected] to handle CustomRepository. I won't explain it specifically, but it will help in some way. https://github.com/nestjs/typeorm/pull/1233

You need to provide some classes and decorators yourself to maintain the same style as [email protected].

1. EntityRepository -> CustomRepository

@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}

@joeizang
joeizang / README.md
Last active February 3, 2024 01:37 — forked from leosuncin/README.md
Install Powerline on Ubuntu 20.04
  1. Install powerline sudo apt install powerline source /usr/share/powerline/bindings/bash/powerline.sh

  2. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh

  3. Add this lines to .bashrc file if bash is what you use. You could add to other files like .zshrc etc. I use bash so there. This ensures that this switch is automatic when you start bash

.bashrc > if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then

@royshouvik
royshouvik / console.ts
Last active October 4, 2022 00:12
Nestjs REPL
import 'dotenv/config';
import { NestFactory } from '@nestjs/core';
import * as repl from 'repl';
import * as Logger from 'purdy';
const LOGGER_OPTIONS = {
indent: 2,
depth: 1,
};
@pantsel
pantsel / docker-compose.yml
Last active October 10, 2024 12:50
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@borgstrom
borgstrom / human_time_duration.py
Created May 9, 2018 04:00
Python: Convert seconds (duration) to human readable string
TIME_DURATION_UNITS = (
('week', 60*60*24*7),
('day', 60*60*24),
('hour', 60*60),
('min', 60),
('sec', 1)
)
def human_time_duration(seconds):
(async function () {
const token = JSON.parse(localStorage.getItem('user')).token;
const headers = new Headers();
const url = 'https://web-api.snapp.ir/api/v1/ride/history';
const query = '?page=';
let total = 0;
let page = 1;
headers.append('Authorization', token);
headers.append('Content-Type', 'application/json');
/**
* Open https://app.snapp.ir
* Login with your credentials
* Copy and pasting this code in developer tools console
* Waiting... :)
*/
(async function () {
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@scottoffen
scottoffen / ContentType.cs
Last active October 28, 2024 14:32
C# ContentType Enum full source code
using System;
using System.Reflection;
namespace Grapevine
{
public enum ContentType
{
[Metadata(Value = "application/x-authorware-bin", IsBinary = true)]
AAB,