Skip to content

Instantly share code, notes, and snippets.

View stockhuman's full-sized avatar

Michael Hemingway stockhuman

View GitHub Profile
@k1sul1
k1sul1 / .htaccess
Created September 19, 2016 09:46
Serve Vue.js (vue-loader) project inside a WordPress installation as a subdirectory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^static/(.*)$ /subfolder/static/$1 [R=301,NC,L] # magic line, rewrite requests to domain.com/static to domain.com/subfolder/static. Quite useful on locked webhosts.
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
@willybahuaud
willybahuaud / translate-taxonomy-slug.php
Last active February 13, 2020 18:38
Translate Taxonomy base slug wpml
<?php
add_action( 'init', 'register_my_taxo' );
function register_my_taxo() {
register_taxonomy( 'immo_cat', 'immobilier', array(
'hierarchical' => false,
'label' => 'Type de biens',
// je déclare le slug de taxo de manière à pouvoir le traduire
'rewrite' => array( 'slug' => icl_t('nebula', 'property-type-slug', 'type-bien-immobilier' ) ),
) );
}
@sansumbrella
sansumbrella / LICENSE
Last active June 11, 2020 07:45
Reaction Diffusion Simulation in GLSL
/*
* Copyright (c) 2016 David Wicks, sansumbrella.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@meshula
meshula / 3d-formats.md
Last active March 30, 2022 18:45
3d file formats, last mile vs. interchange
@bmoredrew
bmoredrew / sort-by-acf-repeater-field.php
Last active May 7, 2022 08:15
Sort Posts by ACF Repeater Field Using Multidimensional Array
<?php
// Create an empty array for storage
$post_data = array();
// Set arguments for your query
$args = array(
'post_type' => 'trips',
'posts_per_page' => 999
);
// Only export the things that are actually needed, cut out everything else
export { WebGLRenderer } from 'three/src/renderers/WebGLRenderer.js'
export { ShaderLib } from 'three/src/renderers/shaders/ShaderLib.js'
export { UniformsLib } from 'three/src/renderers/shaders/UniformsLib.js'
export { UniformsUtils } from 'three/src/renderers/shaders/UniformsUtils.js'
export { ShaderChunk } from 'three/src/renderers/shaders/ShaderChunk.js'
export { Scene } from 'three/src/scenes/Scene.js'
export { Mesh } from 'three/src/objects/Mesh.js'
export { LineSegments } from 'three/src/objects/LineSegments.js'
@miguel-perez
miguel-perez / readyExec.js
Last active January 29, 2023 18:04
How to add the ability to re-run $(document).ready() functions
/**
* Replace jQuery's $.fn.ready() function with a mod exec
*
* Sites that make heavy use of the $(document).ready function
* are generally incompatable with asynchrounous content. The
* the $.fn.ready function only runs once. This script replaces
* the ready function with a module execution controller that
* let's us register functions and execute all of the functions
* as we need them. This is useful after HTML gets injected on the
* page and we want to rebind functionally to the new content.
@supermamon
supermamon / config.json
Last active May 3, 2023 22:52
Mars Rover Camera for Homebridge
"platforms": [
{
"platform": "Camera-ffmpeg",
"name": "Camera FFmpeg",
"cameras": [
{
"name": "Curiosity NAVCAM",
"videoConfig": {
"source": "-f image2 -loop 1 -s 720x480 -pix_fmt yuvj422p -i /homebridge/cams/curiosity-NAVCAM-curr.jpg"
}
@sabatale
sabatale / montreal-fsa-polygons.geojson
Created March 15, 2021 23:59
Geojson with postal codes FSA polygons for Montréal, QC, Canada.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.