Skip to content

Instantly share code, notes, and snippets.

@wandernauta
wandernauta / sp
Last active June 3, 2025 10:02
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@dtbaker
dtbaker / custom_dashboard_widgets.php
Created January 20, 2015 23:46
This is an example of how to add widgets to the UCM dashboard
<?php
// upload this file to includes/plugin_custom_dashboard_widgets/custom_dashboard_widgets.php
class module_custom_dashboard_widgets extends module_base{
public static function can_i($actions,$name=false,$category=false,$module=false){
if(!$module)$module=__CLASS__;
return parent::can_i($actions,$name,$category,$module);
}
@carlos22
carlos22 / install-imapsync.sh
Last active July 4, 2018 10:01
Install imapsync on Ubuntu 14.04 (trusty)
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install makepasswd rcs perl-doc libio-tee-perl git libmail-imapclient-perl libdigest-md5-file-perl libterm-readkey-perl libfile-copy-recursive-perl build-essential make automake libunicode-string-perl
cd $HOME
git clone git://github.com/imapsync/imapsync.git --depth 1
cd imapsync
sudo make install
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@matriphe
matriphe / ssh-telegram.sh
Last active April 16, 2025 20:24
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@wodCZ
wodCZ / force-http.tpl
Last active March 25, 2024 21:23
vestacp cert letsencrypt
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
location / {
rewrite ^(.*) https://%domain_idn%$1 permanent;
}
}
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active June 29, 2025 14:27 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@jayllellis
jayllellis / custom-action-url.php
Last active August 3, 2021 08:34
Custom Contact Form 7 action URL
<?php
// Place this in your functions.php file
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
function wpcf7_custom_form_action_url(){
return 'send.php';// replace this with the new action url (excluding the 'http://')
}
?>
@rniswonger
rniswonger / wp-disable-plugin-update.php
Last active November 18, 2024 16:54
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@mouse0270
mouse0270 / rapidDefer.js
Last active January 20, 2019 16:19
Defer Inline Javascript
// With $script variable
$(document).ready(function() {
$('script[type="text/javascript/defer"]').each(function() {
var $script = $('<script type="text/javascript"/>').text($(this).clone().text());
$(this).after($script).remove();
});
});
// Without $script variable
$(document).ready(function() {