Skip to content

Instantly share code, notes, and snippets.

View ishukshin's full-sized avatar

ishukshin ishukshin

View GitHub Profile
<?php
use Mail;
// views/emails/reset.blade.php шаблон
// user,info передаются в шаблон
Mail::send('emails.reset', ['user' => $user, 'info' => $info], function ($m) use ($user) {
$m->from(env('MAIL_FROM'));
$m->to($user->email)->subject('Запрос в службу поддержки');
});
<?php
public function setSaratov() {
$this->region = 'saratov';
$this->links = [
'http://www.saratov.vybory.izbirkom.ru/region/region/saratov?action=show&tvd=100100067796072&vrn=100100067795849&region=64&global=true&sub_region=64&prver=0&pronetvd=0&vibid=26420001135285&type=233',
'http://www.saratov.vybory.izbirkom.ru/region/saratov?action=show&global=true&root=642000026&tvd=26420001135271&vrn=100100067795849&prver=0&pronetvd=0&region=64&sub_region=64&type=233&vibid=26420001135271',
'http://www.saratov.vybory.izbirkom.ru/region/region/saratov?action=show&tvd=100100067796069&vrn=100100067795849&region=64&global=true&sub_region=64&prver=0&pronetvd=0&vibid=26420001135250&type=233',
'http://www.saratov.vybory.izbirkom.ru/region/region/saratov?action=show&tvd=100100067796069&vrn=100100067795849&region=64&global=true&sub_region=64&prver=0&pronetvd=0&vibid=26420001135249&type=233',
'http://www.saratov.vybory.izbirkom.ru/region/region/saratov?action=show&tvd=100100067796069&vrn=100100067795849&region=64&g
<html>
<head>
<style>
#console{
border:1px solid lightgreen;
padding:10px;
}
</style>
</head>
<body>
@ishukshin
ishukshin / Arduino Song
Created January 2, 2018 11:06 — forked from eznj/star_wars.ino
Arduino Star Wars Song for Piezo
**/
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
@ishukshin
ishukshin / marcha_imperial
Created January 2, 2018 11:06 — forked from tagliati/marcha_imperial
Marcha imperial para arduino
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
@ishukshin
ishukshin / AntiDos.php
Created May 3, 2018 16:15
Simple laravel app filtering of bad clients using middleware
<?php
// app/Http/Middleware/AntiDos.php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Closure;
use File;
class AntiDos
{
@ishukshin
ishukshin / ElectionService.php
Created May 19, 2018 01:02
Making json files concerning Russian presidental elections-2018 using laravel artisan
<?php
namespace App\Services;
use Cache;
use Storage;
class ElectionService {
/**
@ishukshin
ishukshin / JsonAppend.php
Last active May 30, 2018 20:31
Testing of different methods of appending data to a json file
<?php
...
private function _appendJson($file, $data, $first = false) {
$fd = fopen($file, 'r+');
fseek($fd, -1, SEEK_END);
fwrite($fd, ($first ? '' : ',') . json_encode($data) . ']');
fclose($fd);
}
// wrong file format. Just measuring speed
@ishukshin
ishukshin / esp8266-eeprom-webserver.ino
Created June 16, 2018 19:54
Simple webserver at esp8266. Saves value in EEPROM and auto-updates input value in open browsers if changed by any user or the system.
#include <ESP8266WiFi.h> //Содержится в пакете
#include <ESP8266WebServer.h> //Содержится в пакете
#include <ESP8266SSDP.h>
#include <EEPROM.h>
// IP адрес устройства
IPAddress apIP(192, 168, 4, 1);
// Web интерфейс для устройства
ESP8266WebServer HTTP(80);
<?php
use Request;
use Validator;
use \GuzzleHttp\Client;
// ... in the boot()
Validator::extend('recaptcha', function($attribute, $value, $parameters, $validator) {
if(!$value) {
return false;
}