Skip to content

Instantly share code, notes, and snippets.

@RobinDev
RobinDev / squidanonymousproxy.md
Last active May 4, 2024 00:19
Install a SQUID anonymous proxy
  1. Install SQUID
apt-get install squid
  1. Create an user
htpasswd -md /etc/squid3/users myuserlogin`
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active May 4, 2024 00:19
Ubuntu and Debian Cloud images in Proxmox
@zackpyle
zackpyle / modify-bb-post-autosuggest-dropdown.php
Last active May 4, 2024 00:19
Add URL to Beaver Builder Post module auto suggest dropdown
<?php
// Modify the data returned for BB post module auto suggest queries to include post URLs
add_filter('fl_builder_auto_suggest_posts_lookup', function ( $data ) {
foreach ( $data as $key => $post ) {
$post_object = get_post( $post['value'] );
// If the post object exists, append the URL path to the title
if ( $post_object ) {
$permalink = get_permalink( $post['value'] );
@moehlone
moehlone / make_writable.js
Created March 17, 2016 08:27
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**
@detain
detain / bash_shopt.md
Created May 4, 2024 00:09
BASH (shopt) Shell Options Explained

Bash Shel Options ( shopt ) Explained

I wasted time WTFM so RTFM

Enable OptionDisable OptionList Enabled OptionsEnabled Options Sample Output
shopt -s <opt>
shopt -u <opt>
echo $BASHOPTS
checkwinsize:cmdhist:complete_fullquote

This table illustrates the behavior of various shopt options in bash. By toggling these options, you can influence how the shell handles things like filename completion, history management, and error handling.

Option Description Disabled Enabled Example
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 4, 2024 00:04
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@zachdaniel
zachdaniel / stream_distribute.ex
Last active May 4, 2024 00:02
A small demo to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`. Open in Livebook: https://livebook.dev/run?url=https%3A%2F%2Fgist.github.com%2Fzachdaniel%2Fd5ab06a9d2362fceeb6d27c37b206e28
<!-- livebook:{"persist_outputs":true} -->
# Distribute
## Section
A small toy to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`.
```elixir
defmodule Distribute do
@joaovictorino
joaovictorino / rode seu primeiro contêiner docker.md
Last active May 4, 2024 00:02
rode seu primeiro contêiner docker

Rode seu primeiro contêiner Docker

Abra o terminal e execute o seu primeiro contêiner "hello-world"

docker run hello-world

Analise a saída e percebe que duas ações foram feitas pelo Docker, baixar a imagem para sua máquina e executar o contêiner. Agora execute o comando abaixo

@Konfekt
Konfekt / chatgpt-write-msg.py
Last active May 4, 2024 00:02
let ChatGPT write a sensible commit message using an adaptable Python script
#!/usr/bin/env python3
# Adaption of https://github.com/tom-doerr/chatgpt_commit_message_hook/main/prepare-commit-msg
#
# Mark this file as executable and add it into the global hooks folder
# whose path is given by the core.hooksPath configuration variable
# skip during rebase
import sys
if len(sys.argv) > 2: