Skip to content

Instantly share code, notes, and snippets.

View creativecoder's full-sized avatar

Grant Kinney creativecoder

View GitHub Profile
@FCLC
FCLC / PopOS_amdgpu.md
Last active July 9, 2024 10:58
Installing amdgpu-pro on popOS to enable OpenCL, ROCm and HIP

currently out of date as of September 2022, needs a fresh update

TLDR; edit the amdgpu-install script to add pop as supported debian distribution, comment out check for linux-modules-extra-[versions] since they're provided by linux-modules [per Jeremy Solle of System_76], then run with --no-dkms

3 EDIT: 4 things need to be done.

Problem 1) Pop!_OS not valid install target "Unsupported OS: /etc/os-release ID 'pop'" The issue as of now is that amdgpu-install doesnt recognize pop as a valid installation candidate. Solution is to add pop as a valid target in the amdgpu-install script.

@developit
developit / unistore.js
Last active September 8, 2020 15:13
Update: the newer & better version of this is published: https://github.com/developit/unistore
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
<template lang="pug">
ul.pagination
li.item: a.link.first(@click.prevent="$emit('first-page')") First
li.item: a.link.prev(@click.prevent="$emit('prev-page')") Prev
li.item(v-for="i in pageTotal")
a.link.num(
@click.prevent="$emit('set-current-page', i)",
:class="i == currentPage ? '-current' : ''"
) {{i}}
li.item: a.link.next(@click.prevent="$emit('next-page')") Next
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@DavidWells
DavidWells / deploy.sh
Last active August 29, 2015 14:12
Deploying WordPress Plugin to Github and then to WordPress.org SVN
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# Instructions
#
# Important!!!!!
# Replace YOUR-WORDPRESS-PLUGIN-SLUG-HERE, YOUR-WORDPRESS-MAIN-PLUGIN-FILE-HERE, YOUR_WORDPRESS_USERNAME_HERE with yours
# End Important!!!!!
#
@erobert17
erobert17 / bootstrap-3-vert-offset-shim.css
Last active May 2, 2022 18:36
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active August 22, 2023 20:54 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
@elefontpress
elefontpress / gist:6159651
Last active June 12, 2024 22:48
This is the contract Bearded uses for client work on a time and materials basis. It's worked for us, but I am not a lawyer, so please run it by yours before you use it! Regardless, do whatever you like with it. Use it, share it, change it ... go nuts. Our original contract from 2008 was for fixed-price projects and was based on Andy Clark'e Cont…

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.

<?php
/*
Plugin Name: My Plugin
Author: Jesper van Engelen
Author URI: http://jepps.nl
*/
/**
* Main plugin class for My Plugin
*/
@alettieri
alettieri / functions.php
Last active December 14, 2015 06:29
URL Rewriting in WordPress
<?php
/* Custom Rewrite rules for video embedding */
function flush_player_rules(){
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
add_filter("wp_loaded","flush_player_rules");
function add_player_rewrite($rules){