Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / laravel_xampp_setup.md
Created April 22, 2022 01:16
Laravel Xampp setup on Mac and Windows

Laravel Xampp Setup (Windows & Mac)

Install Xampp

Install Xampp from https://www.apachefriends.org/index.html

  • Run the Xampp installer and open the Xampp control panel
  • Make sure that you enable the Apache and MySQL services
  • On mac you need to click "Start" on the Home tab, "Enable" on the Network tab and "Mount" on the Location Tab. Click "Explore" on the location tab to open your Xampp/Lampp folder

Install Composer

@rahaaatul
rahaaatul / zsh_on_termux.py
Created April 16, 2024 10:29
Installing ZSH on Termux including themes & useful plugins
# Install ZSH, GIT & LSD
pkg install zsh git lsd vim
# Install oh-my-zsh (https://github.com/ohmyzsh/ohmyzsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Add LSD alias to LS in .zshrc
echo "alias ls=lsd" >> ~/.zshrc
# Install Termux-style
@megclaypool
megclaypool / ACF Responsive Background Image.md
Last active April 16, 2024 10:30
Responsive Images (with srcset and sizes) in WordPress (PHP) This is for use in a php template, taking advantage of built-in WP image functions to generate a fancy responsive image tag, complete with srcset and sizes. Set a variable equal to the res

This is Jason's Responsive Background Image Twig Macro translated into PHP for use with ACF image fields:

<?php function responsive_ACF_background_image($image, $display_style, $css_path) {
  $retina_style = $display_style . "2x";
  echo "<style>
      $css_path {
          background-image: url(\"" . $image[sizes][$display_style] . "\");
      }
 @media
@fnky
fnky / ANSI.md
Last active April 16, 2024 10:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@juampynr
juampynr / CHANGELOG.md
Created March 27, 2018 09:35
Sample CHANGELOG

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as

@kokjo
kokjo / sendfd.c
Last active April 16, 2024 10:27
Send a file descriptor over an abstract unix domain socket
// compile with: gcc -static -o sendfd sendfd.c
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <strings.h>
int send_fd(int sock, int fd){
// This function does the arcane magic for sending
// file descriptors over unix domain sockets
struct msghdr msg;
@kayabaNerve
kayabaNerve / .md
Last active April 16, 2024 10:24
FCMP+SA+L

Full-Chain Membership Proofs + Spend Authorization + Linkability

This proposes an extension to FCMPs to make them a drop-in replacement for the exsting CLSAG. In order to be such a replacement, the proof must handle membership (inherent to FCMPs), spend authorization, and linkability.

Terminology

@dimaclara
dimaclara / hello.c
Last active April 16, 2024 10:23
hello world
int main()
{
printf("hello world");
return 0;
}
@xnumad
xnumad / pre-installed-chrome-extensions
Last active April 16, 2024 10:22
Simplest way to get rid of pre-installed Chrome extensions
Sadly, the usual uninstallers of those programs DO NOT remove their "enforcement of pre-installing" extensions into Google Chrome web browser. ("Another program on your computer added an extension that may change the way Chrome works.")
This guidance only contains instructions for Google Chrome.
Enter about://extensions into the adress bar of Google Chrome.
Click on "Details" for the respective extension you want to stop from being pre-installed.
Copy the extension ID from the URL (the text after "id=").
Now remove all these in the registry existing keys at the following paths:
- HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\<id>
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\<id>
- HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\Extensions\<id>
@rokibhasansagar
rokibhasansagar / tg_group_cleaner.py
Created March 4, 2020 20:37
Kick all the deleted accounts from a telegram chat using telethon.
from telethon import TelegramClient
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.types import ChatBannedRights
import asyncio
import datetime
api_id = 1234 # Your API_ID
api_hash = "1a2b3c456" # Your APP_ID