Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fvdm's full-sized avatar
🦖
I may be slow to respond

Franklin fvdm

🦖
I may be slow to respond
View GitHub Profile
@rauchg
rauchg / p.sh
Last active March 12, 2024 04:28
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@denji
denji / README.md
Last active April 5, 2024 10:03 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@JiveDig
JiveDig / remove-tinymce-editor-buttons.php
Last active February 24, 2023 06:00
Remove buttons/items from the WordPress TinyMCE editor
<?php
/**
* Removes buttons from the first row of the tiny mce editor
*
* @link http://thestizmedia.com/remove-buttons-items-wordpress-tinymce-editor/
*
* @param array $buttons The default array of buttons
* @return array The updated array of buttons that exludes some items
*/
add_filter( 'mce_buttons', 'jivedig_remove_tiny_mce_buttons_from_editor');
@bactisme
bactisme / nginx_status_codes.py
Last active April 7, 2022 04:11
Very simple munin plugin to graph nginx HTTP error codes
#!/usr/bin/python
# ALL FAME GOES HERE : https://gist.github.com/mipearson/1146151
#
# 1/ Place where you want (like /usr/share/munin/plugins/nginx_status_codes.py )
# 2/ Link in /etc/munin/plugins/ :
# ln -s /usr/share/munin/plugins/nginx_status_codes.py /etc/munin/plugins/nginx_errors
# chmod +x /etc/munin/plugins/nginx_errors
# 3/ Test with
# munin-run nginx_errors
# 4/ If nescessary : add these lines in your munin conf
@ahmadazimi
ahmadazimi / replace-zero-width-space.php
Last active August 24, 2023 17:04
PHP replace Zero Width Space using preg_replace
<?php
/**
* http://stackoverflow.com/questions/11305797/remove-zero-width-space-characters-from-a-javascript-string
* U+200B zero width space
* U+200C zero width non-joiner Unicode code point
* U+200D zero width joiner Unicode code point
* U+FEFF zero width no-break space Unicode code point
*/
@kometchtech
kometchtech / homebrew.mxcl.pdnsrec.plist
Last active November 29, 2017 02:19
powerdns recursor for Mac OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.pdnsrec</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/pdnsrec/sbin/pdns_recursor</string>
</array>
contacts pushover
contact.pushover.command /path/to/pushover_munin.py
@brianoz
brianoz / class-virtualthemedpage-bc.php
Created February 20, 2014 01:10
WordPress Virtual page with theme
<?php
/*
* Virtual Themed Page class
*
* This class implements virtual pages for a plugin.
*
* It is designed to be included then called for each part of the plugin
* that wants virtual pages.
*
* It supports multiple virtual pages and content generation functions.
@Silvenga
Silvenga / dup-backup.sh
Last active February 25, 2023 10:45
For daily systemwide encrypted backups of Ubuntu servers to remote host of Google Drive (free 15GB of storage).
#!/bin/bash
# Place in /usr/share/backup/
# and make executable
# chmod 0744 dup-backup.sh
# install:
# apt-get install duplicity python-gdata python-gobject-2 python-paramiko
## Remeber to change Google drive user name and Google drive folder
## And change Email
# Must run as root for system wide backups
@davidlevy
davidlevy / convertGeoToPixel.php
Created July 1, 2013 07:32
Function to convert Geo coordinates To Pixels
<?php
function convertGeoToPixel($lat, $lon){
$mapWidth = 400;
$mapHeight = 260;
$mapLonLeft = -180;
$mapLonRight = 180;
$mapLonDelta = $mapLonRight - $mapLonLeft;