Skip to content

Instantly share code, notes, and snippets.

@essamalsaloum
essamalsaloum / linux-cmd-cheatsheet.md
Created June 11, 2021 07:49 — forked from riipandi/linux-cmd-cheatsheet.md
Linux Command Cheat Sheet

#Linux Cheat Sheet

##File Commands:

  • ls – directory listing
  • ls -al – formatted listing with hidden files
  • cd dir - change directory to dir
  • cd – change to home
  • pwd – show current directory
  • mkdir dir – create a directory dir
  • rm file – delete file
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@essamalsaloum
essamalsaloum / django-javascript-variable-interpolation.py
Created June 14, 2020 14:54 — forked from carymrobbins/django-javascript-variable-interpolation.py
Inject JavaScript variables into a Django {% url %} template tag.
from django.template import Context, Template
print Template("""<script type="text/javascript">
var foo = 1,
bar = 2,
url = '{% url view_name obj "'+foo+'" "'+bar+'" %}';
</script>""").render(Context(dict(obj='something')))
# Output:
<script type="text/javascript">
@essamalsaloum
essamalsaloum / How to use Images as Radio buttons.md
Last active February 20, 2020 02:14 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).
@essamalsaloum
essamalsaloum / ssh.md
Created February 11, 2019 01:34 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@essamalsaloum
essamalsaloum / django_cheat_sheet.md
Created January 30, 2019 01:10 — 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
@essamalsaloum
essamalsaloum / django_deploy.md
Created January 30, 2019 01:09 — 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.

// Use !{var} to use unescaped conent
style(type="text/css") !{compiledStyle}
h1.title Invoice number ##{invoice.id}
p.created-at #{invoice.createdAt}
h3 For: #{invoice.customer.number}
table
body {
padding: 20px;
font-family: Halvetica, sans-serif;
.title {
margin-bottom: 4px;
}
.created-at {
font-size: 14px;
import TeaSchool from 'tea-school';
import * as pug from 'pug';
import * as path from 'path';
import {PDFOptions} from 'puppeteer';
import {Options as SassOptions} from 'node-sass';
(async () => {
/********************************
* STYLE OPTIONS *
********************************/