Skip to content

Instantly share code, notes, and snippets.

View faryar76's full-sized avatar
🏠
Working from home

faryar faryar76

🏠
Working from home
View GitHub Profile
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller
{
@faryar76
faryar76 / getEnglishChars
Created January 9, 2019 16:39
with this regex can get english chars from first of string
^[\s\w\d\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]*
//teststringاین متن فارسی است
//output -> teststring
https://stackoverflow.com/questions/8961833/regular-expression-to-match-english-words-with-some-other-characters
@faryar76
faryar76 / filebase.php
Last active March 2, 2019 16:43 — forked from timothymarois/filebase.php
Filebase (V2) Proposal
<?php
$config = [];
$database = new Database($config);
// DATABASE TABLES
// -----------------------------------
base on https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
Reinstall npm with a node version manager§
This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in “Downloading and installing Node.js and npm”. You do not need to remove your current version of npm or Node.js before installing a node version manager.
Manually change npm’s default directory§
Note: This section does not apply to Microsoft Windows.
To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, you will create and use hidden directory in your home directory.
Back up your computer.
@faryar76
faryar76 / dl.php
Created November 8, 2020 07:50 — forked from fzerorubigd/dl.php
A simple download script with resume and multi-part support
<?php
date_default_timezone_set('GMT');
//1- file we want to serve :
$data_file = "/home/f0rud/Aalto Talk with Linus Torvalds [Full-length].mp4";
$data_size = filesize($data_file); //Size is not zero base
$mime = 'application/otect-stream'; //Mime type of file. to begin download its better to use this.
$filename = basename($data_file); //Name of file, no path included
@faryar76
faryar76 / redsocks.conf
Created December 30, 2022 09:20 — forked from afriza/redsocks.conf
Setup iptables for RedSocks in OpenWRT
base {
// debug: connection progress & client list on SIGUSR1
log_debug = on;
// info: start and end of client session
log_info = on;
/* possible `log' values are:
* stderr
* file:/path/to/file