Skip to content

Instantly share code, notes, and snippets.

mikimaine / shape-of-type.ts
Created June 1, 2023 17:26
A TypeScript type that will dynamically knows every nested object property. specially helpful when being used on a dynamic size object you want to access.
type ShapeOf<T extends Record<string, any>> = keyof {
[K in keyof T as T[K] extends string ? K: T[K] extends Record<string, unknown> ? `${K & string}.${ShapeOf<T[K]> & string}` : never]: any
const locales = {
en: {
welcome: 'welcome',
job: {
title: 'Job title',
mikimaine /
Created September 11, 2017 08:23 — forked from andreyvit/
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

namespace App\Http\Requests;
use Illuminate\Validation\Rule;
use App\Http\Requests\Request;
* Class TestRequest.
mikimaine / RequestServiceProvider.php
Last active July 18, 2017 13:44
Request service provider for Lumen
namespace App\Providers;
use App\Http\Requests\Request;
use Laravel\Lumen\Http\Redirector;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\HttpFoundation\Request;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;
mikimaine / Request.php
Last active March 2, 2022 07:38
Request class for Lumen
namespace App\Http\Requests;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
use Laravel\Lumen\Http\Redirector;
use Illuminate\Container\Container;
use Illuminate\Contracts\Validation\Validator;
mikimaine / observable Pattern.js
Created April 24, 2017 08:45
sample observable pattern from RxJs talk
* @param transformFn
* @returns {{subscribe: *, subscribe: *, map: map, map: map, filter: filter, filter: filter, delay: delay, delay: delay, reduce: reduce, reduce: reduce}}
function map(transformFn){
const inputObservable = this;
const outputObservable = createObservable(function subscribe(outputObserver) {
next: function (x) {
mikimaine / darkYouTube
Created April 14, 2017 20:03
Dark YouTube theme + Chnage content location and more features for YouTube....
Execute this on JS console. Then refresh the page and click on your Profile Pic.
You will see new options
var cookieDate = new Date();
cookieDate.setFullYear(cookieDate.getFullYear( ) + 1);
document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE; expires=" + cookieDate.toGMTString( ) + "; path=/";
mikimaine /
Created January 28, 2017 13:04
Joomla! <= 3.6.4 Admin TakeOver , source 'cx' .
# Joomla! <= 3.6.4 Admin TakeOver
#Make sure you have python3 on your machine
#To run the script: chnage the target url variable
#Then open terminal
#in bash run : python3
#thats it
import bs4
import requests