Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Wayne craigiswayne

View GitHub Profile
@FMCorz
FMCorz / kodi.sql
Last active Mar 23, 2018
Find duplicate movies in Kodi
View kodi.sql
-- Find the file ~/.kodi/userdata/MyVideosXX.db
-- Open with sqlite3
-- Run the following statement:
SELECT
m.c00, -- Movie name
p.strPath, -- Path
f.strFilename -- File name
FROM movie m
@emilysnothere
emilysnothere / my_custom_field.php
Last active May 23, 2018
Gravity Form Custom Hidden Fields
View my_custom_field.php
<?php
class My_Custom_Field extends \GF_Field
{
public $type = 'my_custom_field';
public function get_form_editor_button()
{
return array(
'group' => 'advanced_fields',
'text' => __('My Custom Field', 'gravityforms')
@craigiswayne
craigiswayne / cssFromElement.js
Last active Apr 18, 2019
Extract all computed css from an element
View cssFromElement.js
function getAllCSS(element){
if( !element instanceof HTMLElement ){
console.warn("Select a valid HTML Element before proceeding");
return '';
}
let cssString = '';
const cssObj = window.getComputedStyle(element);
let cssAttributes = [];
@ebidel
ebidel / coverage.js
Last active Aug 13, 2019
CSS/JS code coverage during lifecycle of page load
View coverage.js
Moved to https://github.com/ebidel/puppeteer-examples
@tatemz
tatemz / docker-wordpress.sh
Last active Nov 2, 2019
A quick way to get a WordPress installation up and running with Docker
View docker-wordpress.sh
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb:
@NuroDev
NuroDev / raspbian_setup_pms.sh
Last active Feb 9, 2020
Script to download and install Plex Media Server for Raspberry Pi
View raspbian_setup_pms.sh
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install apt-transport-https -y && wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add - && echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list && sudo apt-get update && sudo apt-get install -t jessie plexmediaserver && sudo rm -rf /etc/default/plexmediaserver && echo
# default script for Plex Media Server
# the number of plugins that can run at the same time
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
# where the mediaserver should store the transcodes
View svn_workflow.sh
# create working directory from trunk
svn checkout http://somedomain.com/repo/trunk
# create a branch
svn copy http://somedomain.com/repo/trunk \
http://somedomain.com/repo//branches/feature-do-awesome-thing \
-m "Created branch to implement feature do awesome thing."
# switch working copy
svn switch ^/repo/branches/feature-do-awesome-thing
@WebReflection
WebReflection / certificate.sh
Last active Jul 1, 2020
A basic Self Signed SSL Certificate utility
View certificate.sh
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@craigiswayne
craigiswayne / setup.md
Last active Jul 28, 2020
How to Compile Sass \ Scss via NPM
View setup.md

How to Setup npm and scss \ sass

npm init
npm install node-sass --save
mkdir -p src/styles
touch src/styles/style.scss

In your generated package.json add the following to your scripts entry

@saetia
saetia / gist:1623487
Last active Aug 15, 2020
Clean Install – OS X 10.11 El Capitan
View gist:1623487

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
You can’t perform that action at this time.