Skip to content

Instantly share code, notes, and snippets.

@b0gdanw
b0gdanw / DisableBigSur.sh
Last active March 29, 2024 09:50
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
# frozen_string_literal: true
class RateLimiter
class Error < StandardError; end
class UnknownIntervalError < RateLimiter::Error; end
class WaitTimeError < RateLimiter::Error; end
attr_reader :bucket_name, :interval, :maximum_wait_time, :rate, :redis
def initialize(bucket_name, options = {})
# frozen_string_literal: true
# @see https://gist.github.com/commitshappen/5928740df2e01f256778c2dbd14364a5 for the RateLimiter
module RateLimitable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def rate_limiter(bucket_name, global: {}, local: {})
module Middleware
class BasicMiddleware
def initialize(app)
@app = app
end
def call(env)
# Before the app is called.
status, headers, response = @app.call(env)
# After the app is called.
@christophberger
christophberger / futures.go
Last active November 28, 2022 07:42
Code from appliedgo.net/futures
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan int)
@Konfekt
Konfekt / git-diff.md
Last active December 11, 2023 09:52
git diff common binary files
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.7.2"
@iximiuz
iximiuz / ethsend.py
Last active January 13, 2024 22:18
Send Ethernet frames from Python.
#!/usr/bin/env python3
# Usage: ethsend.py eth0 ff:ff:ff:ff:ff:ff 'Hello everybody!'
# ethsend.py eth0 06:e5:f0:20:af:7a 'Hello 06:e5:f0:20:af:7a!'
#
# Note: CAP_NET_RAW capability is required to use SOCK_RAW
import fcntl
import socket
import struct
@ThePredators
ThePredators / readme-mde.md
Last active April 9, 2024 21:43
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

@dcondrey
dcondrey / _xcode.sh
Last active March 25, 2023 15:15
(macOS Big Sur) Install Xcode from terminal, setup local development with Apache and PHP 8, and other configurations
# Install Command-line tools as dependency for Homebrew
xcode-select --install # Sets the development directory path to /Library/Developer/CommandLineTools
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Mas (command-line interface for Mac App Store)
brew install mas
# Search for Xcode showing only the first 5 results
mas search xcode | head -5