Skip to content

Instantly share code, notes, and snippets.

View mbaneshi's full-sized avatar
👋
happy coding

Mehdi Baneshi mbaneshi

👋
happy coding
View GitHub Profile
@mbaneshi
mbaneshi / django_deploy.md
Created May 23, 2020 06:33 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@mbaneshi
mbaneshi / django_cheat_sheet.md
Created May 23, 2020 06:33 — forked from bradtraversy/django_cheat_sheet.md
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@mbaneshi
mbaneshi / sample.js
Created January 31, 2022 18:19 — forked from WietseWind/sample.js
Fetching all issuer trustlines (node, websocket)
const { XrplClient } = require('xrpl-client')
const account = 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' // The issuer, Bitstamp USD
const currency = 'USD'
const client = new XrplClient()
const main = async () => {
await client.ready()
const { account_data } = await client.send({ command: 'account_info', account })
@mbaneshi
mbaneshi / app.jsx
Created June 26, 2022 21:45 — forked from eddywashere/app.jsx
higher order layout component example in React
import React from 'react';
import { render } from 'react-dom';
import {PageContent, PageSidebar} from './Content';
import Layout from './Layout';
const Example = Layout({Content: PageContent, Sidebar: PageSidebar});
render(Example, document.getElementById('app'))
@mbaneshi
mbaneshi / css-media-queries-cheat-sheet.css
Created September 3, 2022 06:05 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@mbaneshi
mbaneshi / .gist1.learning-go-lessen01.sh
Created June 4, 2023 13:12
this is my first gist ,created by gh cli , and nvim , zellij and kitty
❯ gh gist create --help
Create a new GitHub gist with given contents.
Gists can be created from one or multiple files. Alternatively, pass "-" as
file name to read from standard input.
By default, gists are secret; use '--public' to make publicly listed ones.
USAGE
dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
The options you provided refer to different cryptographic algorithms used for digital signatures. Here's a brief explanation of each:
1. DSA (Digital Signature Algorithm): DSA is a widely used algorithm for digital signatures. It is based on the mathematical concept of modular exponentiation and is primarily used for authentication and integrity verification of digital documents.
2. ECDSA (Elliptic Curve Digital Signature Algorithm): ECDSA is another digital signature algorithm that is based on elliptic curve cryptography. It offers the same functionality as DSA but with smaller key sizes, making it more efficient in terms of computation and storage.
3. ECDSA-SK (ECDSA with Secure Key): ECDSA-SK is an extension of ECDSA that incorporates additional security features for protecting the private key. It typically involves the use of secure hardware modules or tokens to store and perform cryptographic operations using the private key securely.
@mbaneshi
mbaneshi / alacritty.yml
Created June 19, 2023 21:42
alacrity conf
import:
# uncomment the flavour you want below:
# - ~/.config/alacritty/catppuccin/catppuccin-mocha.yml
# - ~/.config/alacritty/catppuccin/catppuccin-macchiato.yml
#- ~/.config/alacritty/catppuccin/catppuccin-frappe.yml
# - ~/.config/alacritty/catppuccin/catppuccin-latte.yml
- ~/.config/alacritty/tokyo-night/zatchheems-tokyo-night-alacritty-theme.yml
#
#this is comment
# Configuration for Alacritty, the GPU enhanced terminal emulator.
@mbaneshi
mbaneshi / a.py
Created June 19, 2023 22:06
py test
import os
print(os.getcwd())
print('hello py')