Skip to content

Instantly share code, notes, and snippets.

View kuwaitbinary's full-sized avatar
💭
Surviving sometimes I am free sometimes I am busy

Abdullah Al Mashmoum kuwaitbinary

💭
Surviving sometimes I am free sometimes I am busy
  • Kuwait
View GitHub Profile
@lennardv2
lennardv2 / 1. Building PHP-MAMP on Apple Silicon M1.md
Last active February 25, 2025 15:28
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
@joedborg
joedborg / launch_vm.sh
Last active May 14, 2025 13:29
LXD Ubuntu VM launch and disk resize
#!/bin/env bash
set -e
readonly VM="banana"
readonly CPU="8"
readonly MEM="8GB"
readonly DSK="120GB"
lxc init images:ubuntu/focal ${VM} -p default -p vm --vm
@benjamingwynn
benjamingwynn / open
Last active March 20, 2023 05:59
macOS open command for WSL (Windows Subsystem for Linux)
#!/bin/bash
# open
# macOS open command for WSL (Windows Subsystem for Linux)
# written by benjamin gwynn (https://benjamingwynn.com)
# get latest version here: https://gist.github.com/benjamingwynn/a778aa6cf2dd461dc18978f245bd90c1
#
# You can run this on WSL wuth no prior setup or changes to host Windows.
#
# See: * https://docs.microsoft.com/en-us/windows/wsl/interop#run-windows-tools-from-linux
# * https://stackoverflow.com/a/501295
@aggarwalsushant
aggarwalsushant / ublockStaticCustomFilters.txt
Last active July 26, 2025 08:31
uBlock Origin Custom filters | Ad block | Adblock list | Pure Youtube experience - Purest 0 Ads in Video
! Custom static filter list - Sushant Aggarwal
!__________________________ Google & Youtube Ads __________________________
# Zero Ads in Youtube Videos | No watermarks, Cards, Info. Nothing! Zilch! Nada!
||youtube.com/annotations_
youtube.com##.ytp-ce-element-show
youtube.com##.ytp-ce-element
youtube.com##.ytp-cards-teaser-text
youtube.com##.ytp-cards-button-icon-default
youtube.com##.annotation-type-text.annotation
To isolate the layer in which the issue is occurring, information concerning kernel, firewall and network interface states will help in resolving the issue at hand.
You should be able to leverage the Web Console for the droplet to evaluate the details of the following commands.
First, we would recommend reviewing the contents of your interface configuration file.
From here you can ensure that there is an entry for your public interface and that it contains correct information including your public IPv4 address, gateway, netmask, etc.
If needed, you can reference the information made available to you on the 'Networking' page of your Droplet or under your web console screen to ensure this information is correct.
cat /etc/netplan/50-cloud-init.yaml
Next, you will need to ensure that your network managing service is able to pick up on these details and bring up your public interface.
@bonniss
bonniss / github-search-cheatsheet.md
Last active July 27, 2025 07:49
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

OSX 10.9 Mavericks
https://apps.apple.com/app/id675248567
OS X 10.10 Yosemite
https://apps.apple.com/app/id915041082
OS X 10.11 El Capitan
https://apps.apple.com/app/id1147835434
macOS 10.12 Sierra
import 'dart:convert';
import "dart:io";
import 'package:html/dom.dart';
import 'package:html/parser.dart' as parser;
import "package:http/http.dart" as http;
import 'package:http/http.dart';
import "package:yaml/yaml.dart";
main() async {
@madan712
madan712 / export_db_csv.py
Created June 27, 2019 20:12
Python - Export database table to csv file
import mysql.connector
def fetch_table_data(table_name):
# The connect() constructor creates a connection to the MySQL server and returns a MySQLConnection object.
cnx = mysql.connector.connect(
host='localhost',
database='schema',
user='user',
password='password'
@loushou
loushou / main.dart
Last active October 31, 2021 18:22
Flutter - Programmatically trigger button without directly tapping it #flutter #statemanagement #provider
/*
The goal of this is to show you how to abstract the action of tapping a button,
such that it can be triggered from some other code. In this case we trigger one
button's action from tapping another button... but the principle should carry
over if you are triggering it from somewhere else in the code as well, possibly
not related to a user button tap (maybe after a certain amount of time, or when
another state updates elsewhere in the code).
*/
// this package provides the state management utilities we need for this magic to happen