Skip to content

Instantly share code, notes, and snippets.

View ianthekid's full-sized avatar

Ian Ray ianthekid

View GitHub Profile
@patrickposner
patrickposner / functions.php
Last active April 3, 2024 14:09
Simply Static: Set up a build to run daily with cron.
<?php
register_activation_hook( __FILE__, 'setup_build_cron' );
/**
* Setup a cron job to run daily.
*
* @return void
*/
function setup_build_cron() {
@matinrco
matinrco / mongodbOnDebianWSL.md
Last active February 4, 2023 06:21
Install MongoDB 4.4.1 on Windows 10 WSL 2 (Debian 10/Buster - Ubuntu 20.04 LTS (Focal Fossa))
@PetrGlad
PetrGlad / darktable-export.sh
Last active October 20, 2024 02:47
Darktable batch export example
# Some docs imly source can be a directory, but it does not work actually.
# Below is a workaround
for p in a-source-folder/*
do
# Note that uppercase JPG suffix is not recognized so adding "jpg" to output file name.
darktable-cli --width 3000 --height 3000 --hq true $p $(dirname $p)-export/$(basename ${p%.JPG}.jpg);
done
@gnovaro
gnovaro / lamp_setup.sh
Last active July 19, 2019 14:33
PHP Lamp Setup Nginx + PHP 7.3
#!/bin/bash
# One Click LAMP Server Installer (Ubuntu/Debian) - Roskus
# @author Gustavo Novaro
# @version 3.3.1
# @url https://gist.github.com/gnovaro/5295150774be1794028c15c83313c16e
# Run: sudo ./lamp_setup.sh
###############################################
#Servidor Web http
apt-get install -y nginx
@eladnava
eladnava / mongodb-s3-backup.sh
Last active September 13, 2024 11:42
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@brev
brev / git-overwrite-branch.sh
Created May 14, 2015 21:27
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@eriteric
eriteric / movegfjstofooter.php
Last active December 27, 2024 20:31
Load gravity forms JS in footer
// GF method: http://www.gravityhelp.com/documentation/gravity-forms/extending-gravity-forms/hooks/filters/gform_init_scripts_footer/
add_filter( 'gform_init_scripts_footer', '__return_true' );
// solution to move remaining JS from https://bjornjohansen.no/load-gravity-forms-js-in-footer
add_filter( 'gform_cdata_open', 'wrap_gform_cdata_open' );
function wrap_gform_cdata_open( $content = '' ) {
$content = 'document.addEventListener( "DOMContentLoaded", function() { ';
return $content;
}
add_filter( 'gform_cdata_close', 'wrap_gform_cdata_close' );
@michaelcarwile
michaelcarwile / functions.php
Created August 15, 2014 12:06
Gravity Forms Submit Button Add CSS Class
<?php
//* Copy below this line */
add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );
function form_submit_button($button, $form) {
return '<input type="submit" class="button custom-class-here" id="gform_submit_button_' . $form['id'] . '" value="' . $form['button']['text'] . '">';
}
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@mrazzari
mrazzari / multisite_delete_revisions.php
Last active November 9, 2024 00:45
WP - Multisite delete revisions
<pre><?php
// WordPress Multisite - Delete all revisions from all posts in a netword.
// Quick hack by @mrazzari, 2014.
// For context see this thread started by Kitchin at the forums:
// http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere
// HOWTO
// This snippet is meant to be called as a standalone script.
// Like http://example.com/tmp/multisite_delete_revisions.php