Skip to content

Instantly share code, notes, and snippets.

View simo97's full-sized avatar
🏠
Working from home

adonis simo simo97

🏠
Working from home
View GitHub Profile
<?php
$db=mysqli_connect('localhost', 'root', '', 'crud');
function Saved(){
$name=$_POST['name'];
$address=$_POST['address'];
$query="INSERT INTO info (name, address) VALUES('$name', '$address')";
mysqli_query($db, $query);
header('location: index.php'); //redirection sur index page apres l'insertion
@simo97
simo97 / install virtualenv ubuntu 16.04.md
Created February 17, 2019 23:17 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@simo97
simo97 / remote-git.md
Created May 24, 2019 13:38 — forked from Integralist/remote-git.md
Basic set-up of remote git repository on a standard server

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@simo97
simo97 / postgres-brew.md
Created June 24, 2019 14:29 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
function addDomNodes(nodeToAdd, nodeParentWhereNodeIsAdded, typeOfInsertion = "innerHtml"){
return new Promise((resolve) => {
requestAnimationFrame(() => {
typeOfInsertion === "innerHtml" ? nodeParentWhereNodeIsAdded.innerHTML = nodeToAdd : nodeParentWhereNodeIsAdded.insertAdjacentHTML('beforeend', nodeToAdd);
resolve(nodeParentWhereNodeIsAdded);
}, nodeParentWhereNodeIsAdded);
});
}
function removeDomNodes(domChildToRemove, domParent){
from django.db.models import Q
from django.contrib import messages
class SearchViewMixin:
"""
this mixins allow a class based view to handle dynamically and automatically
a search. It add a GET param name as 's' which hold the searched term, and use
lookup_fields = [] to perform search
@simo97
simo97 / media-query.css
Created September 19, 2019 08:19 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@simo97
simo97 / slugify.js
Created October 29, 2019 21:31 — forked from codeguy/slugify.js
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@simo97
simo97 / vanilla-js-cheatsheet.md
Created December 9, 2019 11:30 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@simo97
simo97 / vanilla-js-cheatsheet.md
Created December 9, 2019 11:30 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet