Skip to content

Instantly share code, notes, and snippets.

@mavitm
mavitm / ssl-localhost-webpack.md
Created September 29, 2022 20:48
SSL support for localhost with Webpack

HTTPS using localhost

To generate a local certiticate and using it, please follow these steps (note: replace MY_DOMAIN, MY_FILENAME and MY_PASSPHRASE based on your choice):

Step 1: Generate private key

openssl genrsa -out MY_FILENAME.key 4096
import hashlib
from collections import OrderedDict
import requests
def sort_od(od):
res = OrderedDict()
for k, v in sorted(od.items()):
if isinstance(v, dict):
res[k] = sort_od(v)
else:
<?php
/**
* HTTP Network Access
*
* Used as a cURL wrapper for the HTTP protocol.
*
* @package october\network
* @author Alexey Bobkov, Samuel Georges
*
#include <SPI.h> //SPI kütüphanemizi tanımlıyoruz.
#include <MFRC522.h> //MFRC522 kütüphanemizi tanımlıyoruz.
#include <Servo.h> //Servo kütüphanemizi tanımlıyoruz.
int RST_PIN = 9; //RC522 modülü reset pinini tanımlıyoruz.
int SS_PIN = 10; //RC522 modülü chip select pinini tanımlıyoruz.
int servoPin = 8; //Servo motor pinini tanımlıyoruz.
Servo motor; //Servo motor için değişken oluşturuyoruz.
MFRC522 rfid(SS_PIN, RST_PIN); //RC522 modülü ayarlarını yapıyoruz.
@mavitm
mavitm / Recaptcha.php
Last active September 16, 2019 12:19
recapcha
<?php
/**
* Created by PhpStorm.
* User: xubuntu2045
* Date: 20.04.2018
* Time: 11:45
*/
namespace Sarki\Project\Classes;
/*
reference link ->https://www.opengeeks.me/2015/08/filechooser-and-android-webview/
https://github.com/OpenGeeksMe/Android-File-Chooser
*/
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
@mavitm
mavitm / sqlFullReturn.php
Created September 22, 2017 10:20
toSql binding
<?php
//throw new \October\Rain\Exception\ApplicationException(@intval($data['page']));
$sql = $query->toSql();
foreach($query->getBindings() as $binding)
{
$value = is_numeric($binding) ? $binding : "'".$binding."'";
$sql = preg_replace('/\?/', $value, $sql, 1);
}
throw new \October\Rain\Exception\ApplicationException($sql);
var indexFinder = function( maxItem, maxNumber, optionalParam ){
this.maxItem = maxItem,
this.maxNumber = maxNumber,
this.optionalParam = optionalParam,
this.myArray = [],
this.arrindexs = [],
this.tools = {
randomNumber : function randomNumber( min, Max ){
return Math.floor(( Math.random() * Max ) + min )
},
@mavitm
mavitm / pageInfo.php
Last active May 23, 2017 21:28
page info
<?php
use Goutte\Client;
use GuzzleHttp\Client as GuzzleClient;
use Illuminate\Filesystem\Filesystem;
$mavitm = \MtmCore\Mavitm::getInstance();
$Admin = new \MtmCore\Admin();
function createAyerFile($finfo){
$client = new Client();
@mavitm
mavitm / Desc.php
Last active October 26, 2016 09:49
Booking.com tsv parser
<?php namespace Mavitm\Hotel\Models;
use Model;
/**
* Model
*/
class Desc extends Model
{