Skip to content

Instantly share code, notes, and snippets.

View Sanix-Darker's full-sized avatar
🐼
coding in the dark...

darker Sanix-Darker

🐼
coding in the dark...
View GitHub Profile
@Sanix-Darker
Sanix-Darker / SUBLIME TEXT 2.X, 3.X UNIVERSAL LICENSE CRACK KEYS COLLECTION FOR WIN, MAC & LINUX WORKING
Created September 17, 2017 20:07
SUBLIME TEXT 2.X, 3.X UNIVERSAL LICENSE CRACK KEYS COLLECTION FOR WIN, MAC & LINuX WORKING
// Sublime Text 3 License Keys //
Sublime Text 2.x (for all Builds)
—– BEGIN LICENSE —–
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
@Sanix-Darker
Sanix-Darker / [PHP] Simples amazing PHP fonctions
Last active April 12, 2018 03:05
[PHP] Simples amazing PHP fonctions
function InsertOrNot($BD){ // Permet de savoir si oui ou non, un truc a ete inserer dans la base de donnees ou pas!
$stmt = $BD->query("SELECT LAST_INSERT_ID()");
$lastId = $stmt->fetch(PDO::FETCH_NUM);
$lastId = $lastId[0];
if($lastId>0){
echo "<center><i class=\"green\"><i class=\"fa fa-check\"></i> Op&eacute;ration &eacute;ffectu&eacute;e<i></center>";
}else{
echo "<center><i class=\"red\"><i class=\"fa fa-times\"></i>Erreur d&eacute;tect&eacute;e<i></center>";
}
@Sanix-Darker
Sanix-Darker / [PHP] Force a download of a file
Last active September 23, 2017 20:47
[PHP] Force a download of a file
<?php
if(isset($_REQUEST['src'])){
$file_name = $_REQUEST['src'];
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"".$file_name."\"");
readfile('../Your_Path_Here/'.$file_name);
exit;
}
?>
@Sanix-Darker
Sanix-Darker / [JS] How to check if jQuery is not already, loaded and call it
Last active September 23, 2017 20:47
[JS] How to check if jQuery is not already, loaded and call it
function myJQueryCode() {
//Do stuff with jQuery
}
if(typeof jQuery=='undefined') {
var headTag = document.getElementsByTagName("head")[0];
var jqTag = document.createElement('script');
jqTag.type = 'text/javascript';
jqTag.src = 'jquery.js';
jqTag.onload = myJQueryCode;
@Sanix-Darker
Sanix-Darker / [PHP] Convert Days to Year, Month, Day Format
Last active May 1, 2022 08:31
[PHP] Convert Days to Year,Month,Day Format
<?php
$convert = '5000'; // days you want to convert
$years = ($convert / 365) ; // days / 365 days
$years = floor($years); // Remove all decimals
$month = ($convert % 365) / 30.5; // I choose 30.5 for Month (30,31) ;)
$month = floor($month); // Remove all decimals
$days = ($convert % 365) % 30.5; // the rest of days
@Sanix-Darker
Sanix-Darker / [PHP] Get IP adress of the visitor
Last active September 23, 2017 20:46
[PHP] Get IP adress of the visitor
<?php
/**
* Ensures an ip address is both a valid IP and does not fall within
* a private network range.
*/
function validate_ip($ip)
{
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {
return false;
}
@Sanix-Darker
Sanix-Darker / [CSS] Nice box Shadows
Created September 23, 2017 20:45
[CSS] Nice box Shadows
.top-box
{
box-shadow: inset 0 7px 9px -7px rgba(0,0,0,0.4);
}
.left-box
{
box-shadow: inset 7px 0 9px -7px rgba(0,0,0,0.4);
}
.right-box
{
@Sanix-Darker
Sanix-Darker / [Ruby] loop Iterraors
Created September 29, 2017 18:14
[Ruby] loop Iterraors
#!/usr/bin/ruby
## Count to 50
1.upto(50) {|n| puts n}
## Count Down to 1
50.downto(1) {|n| puts n}
## Count to 20
(1..20).each {|n| puts n}
@Sanix-Darker
Sanix-Darker / [PHP, JS, HTML] Simple Uploading form with files
Created September 30, 2017 12:41
[PHP, JS, HTML] Simple Uploading form with files
<!-- For a friend D Dark Burning, just copy the block you need, i don't ever test this brick of code but it's work -->
<div class="col-md-3">
<center>
<img id="blah" src="../site/images/product_default.png" alt="Image du produit" style="width: 100%;max-height: 97px;" />
<input type="button" value="Changer l'image" class="btn btn-default" id="addImage" onclick="addImage()">
<input type="file" id="imgInp" name="img" required="required" class="form-control col-md-9 col-xs-12" required="" style="display: none;" onchange="readURL(this,'blah');"/>
</center>
</div>
<div class="col-md-9">
@Sanix-Darker
Sanix-Darker / [HTML][CSS] Nice Simple Tooltip
Created October 2, 2017 05:47
[HTML][CSS] Nice Simple Tooltip
<h1>CSS Directional Tooltips</h1>
<div class="demo">
<p>Data attribute only <a href="#" data-tooltip="I’m the tooltip text">Tooltip</a></p>
<p><code>.tooltip</code> <a href="#" class="tooltip" data-tooltip="I’m the tooltip text.">Tooltip</a></p>
<p><code>.tooltip-top</code> <a href="#" class="tooltip-top" data-tooltip="I’m the tooltip text.">Tooltip</a></p>
<p><code>.tooltip-right</code> <a href="#" class="tooltip-right" data-tooltip="I’m the tooltip text.">Tooltip</a></p>
<p><code>.tooltip-bottom</code> <a href="#" class="tooltip-bottom" data-tooltip="I’m the tooltip text.">Tooltip</a></p>
<p><a href="#" class="tooltip-left" data-tooltip="I’m the tooltip text.">Tooltip</a> <code>.tooltip-left</code></p>