Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🍋
Life gave me lemons, I forked.

Alex Zappa reatlat

🍋
Life gave me lemons, I forked.
View GitHub Profile
#!/bin/bash
########## Install Shadowsocks ##########
# <https://github.com/shadowsocks/shadowsocks/blob/master/README.md>
apt-get update
apt-get install python-pip -y
pip install shadowsocks
@reatlat
reatlat / wp-disable-plugin-update.php
Created June 12, 2019 23:24 — forked from ebetancourt/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* 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 ) {
@reatlat
reatlat / jquery.donetyping.js
Created April 7, 2019 01:22
Jquery custom event handler , triggers when user stop typing.
/*
* $('#element').donetyping(callback[, timeout=1000])
*
* source: http://stackoverflow.com/a/14042239/3705299
*
* Fires callback when a user has finished typing. This is determined by the time elapsed
* @callback: function to be called when even triggers
* @timeout: (default=1000) timeout, in ms, to to wait before triggering event if not caused by blur.
* Requires jQuery 1.7+
* Tested with jQuery 1.11.3
<script type="text/javascript">
// Original idea taken here
// @link https://community.unbounce.com/t/require-business-email-address/14158
(function () {
// set interval to check if jQuery loaded
var int_jQuery = setInterval(function () {
// add additional metood for check free emails
if (typeof lp.jQuery === "function") {
// clear interval for jQuery becoase lp.jQuery already loaded
clearInterval(int_jQuery);
@reatlat
reatlat / nyan-cat-console.js
Created March 17, 2019 03:09 — forked from rdlh/nyan-cat-console.js
Get the NYAN CAT in your developer console !
var _nyan = 0;
var __nyan = [[
"+ o + o ",
" + o + + ",
"o + ",
" o + + + ",
"+ o o + o ",
"-_-_-_-_-_-_-_,------, o ",
"_-_-_-_-_-_-_-| /\\_/\\ ",
"-_-_-_-_-_-_-~|__( ^ .^) + + ",
@reatlat
reatlat / webstoemp-gulpfile.js
Created November 11, 2018 22:11 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@reatlat
reatlat / mailcheck.php
Created September 25, 2018 18:32 — forked from robwent/mailcheck.php
Drop in a folder and browse to it to check php mail is working.
<?php
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Email successfully sent!</p>");
} else {
echo("<p>Email delivery failed!</p>");
}
?>
@reatlat
reatlat / clean_wordpress_head.php
Created September 25, 2018 18:32 — forked from robwent/clean_wordpress_head.php
A collection of snippets for a Wordpress theme's function.php file to clean up the output
<?php
/**
* Core output
**/
//Remove the generator tag
remove_action('wp_head', 'wp_generator');
//Remove the frontend admin bar while in development
@reatlat
reatlat / gist:d81eb8e9cd2f86b46eed778924132f3c
Created September 5, 2018 21:54 — forked from nkint/gist:8563954
ffmpeg in the shell: extracting the first frame of video
i=1
for avi in *.mp4; do
name=`echo $avi | cut -f1 -d'.'`
jpg_ext='.jpg'
echo "$i": extracting the first frame of the video "$avi" into "$name$jpg_ext"
ffmpeg -loglevel panic -i $avi -vframes 1 -f image2 "$name$jpg_ext"
i=$((i+1))
done

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: