Skip to content

Instantly share code, notes, and snippets.

View tahmidbintaslim's full-sized avatar
🎯
Focusing

Tahmid Bin Taslim Rafi tahmidbintaslim

🎯
Focusing
View GitHub Profile
@tahmidbintaslim
tahmidbintaslim / System Design.md
Created June 22, 2021 07:42 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@tahmidbintaslim
tahmidbintaslim / index.html
Created December 10, 2021 07:34
Vue Dropdown Menu
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
@tahmidbintaslim
tahmidbintaslim / functions.php
Created January 5, 2022 09:04 — forked from lmartins/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@tahmidbintaslim
tahmidbintaslim / supply-social-sharing
Created January 26, 2022 10:38 — forked from cshold/supply-social-sharing
A snippet for social sharing buttons in a Shopify theme. Notice the use of theme settings to show/hide each button.
{% comment %}
This snippet is used to showcase each collection during the loop,
'for product in collection.products' in list-collections.liquid.
{% endcomment %}
{% assign shareCountClass = '' %}
{% if template contains 'article' or template contains 'blog' %}
{% capture permalinkURL %}{{ shop.url }}{{ article.url }}{% endcapture %}
@tahmidbintaslim
tahmidbintaslim / web-servers.md
Created May 19, 2022 02:54 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tahmidbintaslim
tahmidbintaslim / dmlu_loggedin_menu.php
Created May 30, 2022 14:44 — forked from sareiodata/dmlu_loggedin_menu.php
Dynamic Menu for Logged In Users
<?php
/*
Plugin Name: Dynamic Menu for Logged In Users
Plugin URI: http://cozmoslabs.com
Description: Serve different menus for logged in / logged out users!
Author: Cristian Antohe
Version: 1.0
Author URI: http://www.cozmoslabs.com/
*
* Copyright (c) 2011-2013 Cristian Antohe - Cozmoslabs.com
<?php
/*
Plugin Name: Profile Builder Custom Page Title on Single User
Plugin URI: http://cozmoslabs.com
Description: Filter wp_title on the Single User Listing
Author: Cristian Antohe
Version: 1.0
Author URI: http://cozmoslabs.com
*/
<?php
/**
* Custom Menu Walker - Special Walker classes that manipulate the menus.
*
* WordPress uses a special “Walker” class that iterates over each data record and then displays this
* record accordingly. The cool thing about that is that we can simply create our own custom walker extending
* that PHP class. That way we dont need to care about fetching the stuff from the database or preparing the
* data arrays. We only need to extend the part of the wordpress code that outputs the list.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
@tahmidbintaslim
tahmidbintaslim / .htaccess
Created June 28, 2022 03:11 — forked from seoagentur-hamburg/.htaccess
UPDATE 2022/05: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.4 - 05/2022
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################