Skip to content

Instantly share code, notes, and snippets.

View arbitrarily's full-sized avatar

Marko Bajlovic arbitrarily

View GitHub Profile
@leophys
leophys / godoc.zsh
Last active August 28, 2023 05:16
Optionally colored and fuzzy findable godoc
### colored and fuzzy go doc
if which bat > /dev/null; then
function _godoc() {
if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then
go doc ${@} | bat -p -l md
elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then
go doc ${@} | bat -p -l go
elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then
go doc ${@} | bat -p -l go
else
@jerome-rdlv
jerome-rdlv / feed-thumbnail.php
Last active December 6, 2022 19:36
WordPress RSS feed post thumbnail for MailChimp
<?php
/**
* This file can be dropped in wp-content/mu-plugins/ to be activated.
* It will add post thumbnails to the RSS feed.
* The image can then be used in MailChimp templates with the *|RSSITEM:IMAGE|* merge tag.
* This implementation is based on useful indications by [vick](https://stackoverflow.com/a/48549541)
*/
// add xml namespace for media element
import requests
import base64
import random
import urllib.request
def download_image(url):
name = random.randrange(10000000, 100000000)
fullname = str(name) + ".jpg"
urllib.request.urlretrieve(url, fullname)
@aelk00
aelk00 / remove-likes.md
Last active March 1, 2024 00:58
Remove all your facebook likes
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active May 22, 2025 19:19
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@prasidhda
prasidhda / common spam words 2020
Last active February 20, 2025 10:28
List of common spam words
0%
0% risk
777
99%
99.9%
100%
100% more
#1
$$$
100% free
@armand1m
armand1m / .skhdrc
Last active May 28, 2025 00:54
⚙️ My yabai and skhd configuration files.
# open terminal
cmd - return : open -n -a "Terminal"
# open chrome
cmd + shift - return : open -n -a "Google Chrome"
# moves focus between windows in the current focused display
alt - h : yabai -m window --focus west
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
@openroomxyz
openroomxyz / WordpressAPI_UploadImage.py
Last active December 23, 2024 21:37
Python WordPress API : How to upload image to wordpress?
import base64, requests, json
def header(user, password):
credentials = user + ':' + password
token = base64.b64encode(credentials.encode())
header_json = {'Authorization': 'Basic ' + token.decode('utf-8')}
return header_json
def upload_image_to_wordpress(file_path, url, header_json):
media = {'file': open(file_path,"rb"),'caption': 'My great demo picture'}
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active June 10, 2025 05:27
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@evanfraser
evanfraser / gravity-forms-button.php
Last active July 13, 2022 17:21
Change Gravity Forms submit input to a button element
<?php
function form_submit_button ($button, $form) {
$button = str_replace("input", "button", $button);
$button = str_replace("/", "", $button);
$button .= "{$form['button']['text']}</button>";
return $button;
}
add_filter('gform_submit_button', 'form_submit_button', 10, 5);