Skip to content

Instantly share code, notes, and snippets.

View SANGED's full-sized avatar

m SANGED

  • @sublimetextpackages
View GitHub Profile
@SANGED
SANGED / Multiple ReCaptcha on the same page
Created September 12, 2017 10:31 — forked from Sanix-Darker/[HTML - JS - PHP] Multiple ReCaptcha on the same page
Google normaly don't permit to do a multiple Recaptcha on the same page, so there is a way to sole this issue!
<?php
require 'recaptchalib.php';
$siteKey = 'XXXXXXXXXXXXXXXXXXXXXX'; // votre clé publique
$secret = 'XXXXXXXXXXXXXXXXXXXXXX'; // votre clé privée
?>
<form>
....
<div class="g-recaptcha" id="Optional-id"></div>
</form>
@Sanix-Darker
Sanix-Darker / Resize image to multiple dimensions (PHP)
Created September 9, 2017 10:56
Resize image to multiple dimensions (PHP)
$valid_formats = array("jpg", "png", "gif", "bmp");
$max_file_size = 1024*7500; //100 kb
$path = "assets/img/photo/"; // Upload directory
$count = 0;
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
foreach ($_FILES['files']['name'] as $f => $name) {
if ($_FILES['files']['error'][$f] == 4) {
@Sanix-Darker
Sanix-Darker / [JS] Using the core $.ajax() method
Last active September 23, 2017 20:49
[JS] Using the core $.ajax() method
// Using the core $.ajax() method
$.ajax({
// The URL for the request
url: "post.php",
// The data to send (will be converted to a query string)
data: {
id: 123
},
// Whether this is a POST or GET request
type: "GET",
@Sanix-Darker
Sanix-Darker / [PHP] Check the current link URI and do action
Last active September 23, 2017 20:49
[PHP] Check the current link URI and do action
@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 / [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>
@Sanix-Darker
Sanix-Darker / [JS]Fixed a div when scroll
Last active October 28, 2017 00:10
[JS]Fixed a div when scroll
$.fn.followTo = function (pos) {
var $this = this,
$window = $(window);
$window.scroll(function (e) {
if ($window.scrollTop() > pos) {
$this.css({
position: 'fixed',
top: 0
@Sanix-Darker
Sanix-Darker / [HTML][JS] Real very Simple autocomplete
Created October 4, 2017 16:50
[HTML][JS] Real very Simple autocomplete
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.devbridge-autocomplete/1.4.3/jquery.autocomplete.min.js"></script>
<style type="text/css">
.autocomplete-suggestions { border: 1px solid #999; background: #fff; cursor: default; overflow: auto; }
.autocomplete-suggestion { padding: 10px 5px; font-size: 1.2em; white-space: nowrap; overflow: hidden; }
.autocomplete-selected { background: #f0f0f0; }
.autocomplete-suggestions strong { font-weight: normal; color: #3399ff; }
</style>
<div id="searchfield">
@Sanix-Darker
Sanix-Darker / AngularJS IONIC upload file
Created November 6, 2017 13:13
AngularJS IONIC upload file
<div ng-if="!profile_tab">
<div class="card-item" ng-click="changeAvatar('id_front')">
<img ng-if="user.individual_profile.national_id_front=='/images/missing.png'"
ng-src="img/auth/missing_card.png" alt="" class="row no-padding">
<img ng-if="user.individual_profile.national_id_front!='/images/missing.png'"
ng-src="{{user.individual_profile.national_id_front}}" alt="" class="row no-padding">
<div class="row peex-first-background text-center card-id">
<span class="text-center">
National ID Front
</span>