Skip to content

Instantly share code, notes, and snippets.

@ursuleacv
ursuleacv / System Design.md
Created January 15, 2021 22:46 — 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?
@lorisleiva
lorisleiva / toSqlWithBindings.php
Last active November 12, 2024 12:14
A little macro to get the SQL from a query builder without the annoying "?".
<?php
use Illuminate\Database\Eloquent\Builder;
Builder::macro('toSqlWithBindings', function () {
$bindings = array_map(
fn ($value) => is_numeric($value) ? $value : "'{$value}'",
$this->getBindings()
);
@vasanthk
vasanthk / AgileContractGuide.md
Created July 19, 2020 20:46 — forked from RobRuana/AgileContractGuide.md
Agile Contract Guide

Agile Contract Guide

This document is a guide to writing agile contracts. Unlike traditional contracts, an agile contract does not specify individual tasks to be completed by the Contractor. Rather, an agile contract specifies how the Client and Contractor interact, and how the Contractor is paid. The Deliverable Work performed for the contract is determined through an ongoing collaboration between the Client and the Contractor.

Agile contracts require a great deal of trust from both the Client and the Contractor. This trust is fostered through tight feedback cycles and well-defined responsibilities that both parties can expect from each other. More so than traditional contracts, an agile contract requires active participation from the Client.

@cagartner
cagartner / deploy.sh
Last active March 21, 2025 14:49
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@BoQsc
BoQsc / Gists.md
Last active April 23, 2025 07:54
How to search my own Gists

Import a MySQL Table or Database to a BigQuery Schema.

Usage:

~/bin/mysql_table_to_big_query.sh bucket_name schema_name table_name

~/bin/mysql_schema_to_big_query.sh bucket_name \[schema_name\].
@kvnxiao
kvnxiao / awesome-selfhosted-sorted-by-stars.md
Last active April 27, 2025 09:31
awesome-selfhosted-sorted-by-stars.md

Awesome-Selfhosted

Awesome

Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.

This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.

See Contributing.

@intotecho
intotecho / A MySQL Table to BigQuery Import Script.md
Last active November 27, 2024 02:06 — forked from shantanuo/mysql_to_big_query.sh
Copy MySQL table to big query.

Import a MySQL Table or Database to a BigQuery Schema.

Usage:

~/bin/mysql_table_to_big_query.sh bucket_name schema_name table_name ~/bin/mysql_schema_to_big_query.sh bucket_name [schema_name].

Description

@mathiasverraes
mathiasverraes / rollyourown.php
Created May 30, 2018 14:17
We don't need no DIC libs / we don't need no deps control
<?php
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck.
// Happy to be proven wrong!
final class Router {
private $dependencies;
public function __construct (Dependencies $dependencies) {
$this->dependencies = $dependencies;
// You might say that this is Service Locator, but it's not. This router is toplevel,
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI.
@Jany-M
Jany-M / gdpr_scripts.php
Last active May 21, 2021 13:55
[GDPR] Scripts to ask / check for user consent (WordPress and JS examples)
<?php
/* --------------------------------------------------------------------------------
*
* JS stand-alone (CSS not included - Get it here https://pastebin.com/uNKPdMVj)
*
-------------------------------------------------------------------------------- */
?>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>