Skip to content

Instantly share code, notes, and snippets.

View laksa19's full-sized avatar

Laksamadi Guko laksa19

View GitHub Profile
@laksa19
laksa19 / search_partial_string_array.php
Created March 30, 2021 10:15 — forked from zuhairkareem/search_partial_string_array.php
Search partial string in an array in PHP
<?php
/**
* First Method.
*/
function array_search_partial($arr, $keyword) {
foreach($arr as $index => $string) {
if (strpos($string, $keyword) !== FALSE)
return $index;
}
}
@laksa19
laksa19 / fade.js
Created June 14, 2020 05:07 — forked from alirezas/fade.js
fadeIn & fadeOut in vanilla js
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();

NGINX and PHP-FPM Manjaro

enable php write

file_put_contents fwrite

edit php-fpm service

sudo nano /usr/lib/systemd/system/php-fpm.service
@laksa19
laksa19 / etchosts.sh
Created July 2, 2018 04:37 — forked from mikeflynn/etchosts.sh
An /etc/hosts manager bash script (v1.1) -- Added import and export commands!
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{
@laksa19
laksa19 / LICENCE SUBLIME TEXT
Created June 27, 2018 02:07
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@laksa19
laksa19 / SimpleHTTPServerWithUpload.py
Last active April 7, 2022 15:05 — forked from amdei/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload and MultiThreading support
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.1"
__all__ = ["SimpleHTTPRequestHandler"]