Skip to content

Instantly share code, notes, and snippets.

View akiyamaSM's full-sized avatar
🔥

Inani El Houssain akiyamaSM

🔥
View GitHub Profile
@akiyamaSM
akiyamaSM / 2019-https-localhost.md
Created October 27, 2022 16:25 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@akiyamaSM
akiyamaSM / routing
Last active February 26, 2020 10:14
<?php
namespace Drupal\JobApplication\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class ApplyForm extends FormBase
{
@akiyamaSM
akiyamaSM / create_user.php
Last active November 14, 2019 10:09
Create a user in Wordpress
$username = 'username123';
$password = 'azerty321';
$email = 'example@example.com';
if (username_exists($username) == null && email_exists($email) == false) {
$user_id = wp_create_user( $username, $password, $email );
$user = get_user_by( 'id', $user_id );
$user->remove_role( 'subscriber' );
$user->add_role( 'author' );
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.container{
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<input type="button" value="next" onclick="change()" />
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.full.min.js"></script>
<script>
$(function () {
$('.datedefaulthourpicker').datetimepicker({
@akiyamaSM
akiyamaSM / Carddetection.js
Created May 10, 2018 16:17 — forked from swapnilmishra/Carddetection.js
Javascript function to detect type of debit/credit card
function getCardType(cardNum) {
if(!luhnCheck(cardNum)){
return "";
}
var payCardType = "";
var regexMap = [
{regEx: /^4[0-9]{5}/ig,cardType: "VISA"},
{regEx: /^5[1-5][0-9]{4}/ig,cardType: "MASTERCARD"},
{regEx: /^3[47][0-9]{3}/ig,cardType: "AMEX"},
@akiyamaSM
akiyamaSM / shake.html
Last active June 19, 2017 13:06
Css3 Shake effect on hover
<html>
<head>
<title></title>
<style type="text/css">
.rect{
cursor: default;
display: block;
width: 400px;
height: 140px;
background-color: lightblue;
@akiyamaSM
akiyamaSM / books.html
Last active August 27, 2017 18:34
How to Manage lists using vueJs
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script>
</head>
<body>
<div id="app">
<label>Name</label> <input type="text" id="name" v-model="newBook.name" /> <br />
<label>Author</label> <input type="text" id="author" v-model="newBook.author" /> <br />
<label>Pages</label> <input type="text" id="author" v-model="newBook.totalPages" /> <br />