Skip to content

Instantly share code, notes, and snippets.

View SANGED's full-sized avatar

m SANGED

  • @sublimetextpackages
View GitHub Profile
@Sanix-Darker
Sanix-Darker / Create_your_free_onion_website_on_Tor_network.sh
Last active November 7, 2023 12:37
Create your free onion website on Tor network
#Creating an .onion service in the Tor network is as simple as editing /etc/tor/torrc and adding:
HiddenServiceDir /var/lib/tor/www_service/
HiddenServicePort 80 127.0.0.1:80
# After restarting the tor service with
sudo service tor restart
# or
sudo service tor reload
# The directory will be created automagically, and inside the new directory, two files are generated, hostname and private_key.
@Sanix-Darker
Sanix-Darker / Preview Image
Created September 9, 2017 09:16
Preview Image
<img id="blah" src="#" alt="Image du blog" style="width: 30%;" />
<input type="file" id="imgInp" name="img" required="required" class="form-control col-md-9 col-xs-12" required="" />
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<script>
function readURL(input,cible) {
if (input.files && input.files[0]) {
@Sanix-Darker
Sanix-Darker / [SHELL, MONGO]MONGODB CLI
Last active April 29, 2020 05:54
[SHELL, MONGO]MONGODB CLI
// Create database:
use database
// Create a collection by insering some thing in it:
db.testCollection.insert({"test":"test"})
show dbs
// LIst Data Base
show collections
@Sanix-Darker
Sanix-Darker / [PYTHON]import a module on sup folder PYTHON withouth been a package (containing a __init__.py file).py
Last active October 11, 2019 12:33
[PYTHON]import a module on sup folder PYTHON withouth been a package (containing a __init__.py file)
from os import path as ospath
from sys import path as syspath
# moving the path outside of the current dir
syspath.insert(1, ospath.join(syspath[0], '..'))
import module
# Or just in a specific parent directory in the sup folder:
# import sys
# sys.path.insert(0, '../module/')
@Sanix-Darker
Sanix-Darker / [PHP]Class_decoupage_Panda.php
Last active September 5, 2019 20:40
[PHP]Writing text on Animated GIF PHP
Class PANDA_decode {
var $PANDA_TR = - 1;
var $PANDA_TG = - 1;
var $PANDA_TB = - 1;
var $PANDA_TI = 0;
var $PANDA_buffer = Array();
var $PANDA_arrays = Array();
var $PANDA_delays = Array();
var $PANDA_dispos = Array();
var $PANDA_stream = "";
@Sanix-Darker
Sanix-Darker / External URLs
Created September 9, 2017 09:10
External URLs
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>External URLs</title>
</head>
<body>
<ion-view title="Test Page">
<ion-content>
@Sanix-Darker
Sanix-Darker / [HTML - JS - PHP] Multiple ReCaptcha on the same page
Last active March 28, 2018 10:08
[HTML - JS - PHP] Google normaly don't permit to do a multiple Recaptcha on the same page, so there is a way to solve this issue!
<?php
// Configure your keys (secret, piblic): https://www.google.com/recaptcha
$siteKey = 'XXXXXXXXXXXXXXXXXXXXXX'; // votre clé publique
?>
<form action="submit.php">
....
<div class="g-recaptcha" id="Optional-id"></div>
</form>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
<script type="text/javascript" charset="utf-8">
@Sanix-Darker
Sanix-Darker / Get the last insert Id (PHP and MySQL)
Created September 9, 2017 10:47
Get the last insert Id (PHP and MySQL)
$stmt = $BD->query("SELECT LAST_INSERT_ID()");
$lastId = $stmt->fetch(PDO::FETCH_NUM);
$lastId = $lastId[0];
@Sanix-Darker
Sanix-Darker / [JS] angular.merge FOR OLDER VERSIONS
Created February 21, 2018 07:32
[JS] angular merge angular.merge FOR OLDER VERSIONS
function merge(obj1,obj2){ // Our merge function
var result = {}; // return result
for(var i in obj1){ // for every property in obj1
if((i in obj2) && (typeof obj1[i] === "object") && (i !== null)){
result[i] = merge(obj1[i],obj2[i]); // if it's an object, merge
}else{
result[i] = obj1[i]; // add it to result
}
}
for(i in obj2){ // add the remaining properties from object 2
@Sanix-Darker
Sanix-Darker / Github credentials (See - Modify - Delete)
Last active January 21, 2018 12:01
Github credentials (See - Modify - Delete)
Github credentials: Control Panel\User Accounts and Family Safety\Credential Manager
Then click on Windows Credentials