Skip to content

Instantly share code, notes, and snippets.

:octocat:
Opensourcing stuffs

adonis simo simo97

:octocat:
Opensourcing stuffs
Block or report user

Report or block simo97

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UsefulDjangoMixins.py
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
View fast_dom_insert_remove_by_edNewgate.js
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){
@simo97
simo97 / postgres-brew.md
Created Jun 24, 2019 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)
View postgres-brew.md

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@simo97
simo97 / remote-git.md
Created May 24, 2019 — forked from Integralist/remote-git.md
Basic set-up of remote git repository on a standard server
View remote-git.md

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 / install virtualenv ubuntu 16.04.md
Created Feb 17, 2019 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04
View install virtualenv ubuntu 16.04.md

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
View server.php
<?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
View web_compoment_objects.html
<!DOCTYPE html>
<html>
<head>
<!-- Importing Web Component's Polyfill -->
<script src="bower/platform/platform.js"></script>
<!-- Importing Custom Elements -->
<link rel="import" href="../src/image-object-tracking.html">
</head>
<body>
<!-- Using Custom Elements -->
View object_detector.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<!-- include dataset for each objet type -->
<script src="data/face.js"></script>
<script src="data/eye.js"></script>
View color_detection_cutom_colors.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
@simo97
simo97 / color_detection.html
Created Jan 27, 2019
Detect color into a video
View color_detection.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
You can’t perform that action at this time.