Skip to content

Instantly share code, notes, and snippets.

View phmongeau's full-sized avatar
🤖

Philippe Mongeau phmongeau

🤖
View GitHub Profile
@phmongeau
phmongeau / keymap.c
Created May 20, 2017 02:01
tada68 qmk keymap
#include "tada68.h"
#include "action_layer.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0 // QWERTY
#define _FL 1 // Function layer #1
@phmongeau
phmongeau / wavepot
Created October 12, 2014 18:05
music thingy
function pulse(freq, offset, t) {
return Math.sin(2 * Math.PI * t * freq)
+ Math.sin(2 * Math.PI * t * (freq + (1* offset)))
+ Math.sin(2 * Math.PI * t * (freq + (2*offset)));
}
function noise() {
return Math.random();
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phmongeau
phmongeau / selectInstances.mel
Last active December 18, 2015 03:08
select all instances of selected object.
string $sel[] = `ls -sl`;
string $shapes[] = `listRelatives -path -s $sel[0]`;
select `listRelatives -ap -path $shapes[0]`;
@phmongeau
phmongeau / getMirror.mel
Created May 4, 2013 20:06
mel script to get opposite object name
proc string getMirror(string $obj_name) {
string $reg = "_[RL]_";
string $side = `match $reg $obj_name`;
string $otherside = "_L_";
if($side == "_L_") {
$otherside = "_R_";
}
else if ($side == "_T_" || $side == "_C_") {
$otherside = $side;
}
@phmongeau
phmongeau / ik_fk_snap.mel
Created April 21, 2013 04:14
IK_FK snap
float $arm1RX = `getAttr JT_L_ikArm_1.rx`;
float $arm1RY = `getAttr JT_L_ikArm_1.ry`;
float $arm1RZ = `getAttr JT_L_ikArm_1.rz`;
setAttr JT_L_fkArm_1.rx $arm1RX;
setAttr JT_L_fkArm_1.ry $arm1RY;
setAttr JT_L_fkArm_1.rz $arm1RZ;
@phmongeau
phmongeau / EX_L_footRoll
Last active December 16, 2015 11:29
foot roll maya expression
if(RG_L_footIcon_1.ballX < 0) {
JT_L_heelCtrl_1.rotateX = RG_L_footIcon_1.ballX;
JT_L_toesTipCtrl_1.rotateX = 0;
}
else if (RG_L_footIcon_1.ballX < 50) {
JT_L_heelCtrl_1.rotateX = 0;
JT_L_toesTipCtrl_1.rotateX = 0;
JT_L_ballCtrl_1.rotateX = 1 - RG_L_footIcon_1.ballX;
}
else {
@phmongeau
phmongeau / init.js
Created April 5, 2013 23:25
a plugin for ttrss
function getAdjacentArticleId() {
var next_id, prev_id
var rows = getVisibleArticleIds();
var c_id = ""+getActiveArticleId();
if (!c_id) {
next_id = rows[0];
prev_id = rows[rows.length-1]
} else {
c_index = rows.indexOf(c_id);
@phmongeau
phmongeau / disableAutoplay.js
Created November 11, 2012 04:49
Disable autoplay userscript
// ==UserScript==
// @id com.phmongeau.ytnoauto
// @name Youtube NoAuto
// @version 1.0
// @namespace com.phmongeau.youtube.noauto
// @author Philippe Mongeau
// @description
// @include *youtube.com/watch?*
// @run-at document-start
// ==/UserScript==