Skip to content

Instantly share code, notes, and snippets.

View mottosso's full-sized avatar

Marcus Ottosson mottosso

View GitHub Profile
@mottosso
mottosso / README.md
Last active January 3, 2024 10:07
LinkedIn Ad-blocker

On LinkedIn, some of the posts in your "Feed" are ads. They carry a little indicator (by law) to tell you as much. This script looks for those indicators and hides it for you. It works by installing an event listener for when you scroll, and looks for newly promoted posts to hide.

Usage

Copy/paste the above script into your Console when visiting LinkedIn. You can use an extension to run the above script whenever visiting LinkedIn, such as "Custom JavaScript for Websites 2"


Changes

@mottosso
mottosso / CMakeLists.txt
Last active April 7, 2021 10:41
Maya 2022 crash - dagItem was nullptr
#-
# ==========================================================================
# Copyright (c) 2018 Autodesk, Inc.
# All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# unpublished proprietary information written by Autodesk, Inc., and are
# protected by Federal copyright law. They may not be disclosed to third
# parties or copied or duplicated in any form, in whole or in part, without
# the prior written consent of Autodesk, Inc.
@mottosso
mottosso / CMakeLists.txt
Last active March 19, 2023 00:53
Callback on removal, even on undo?
#-
# ==========================================================================
# Copyright (c) 2018 Autodesk, Inc.
# All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# unpublished proprietary information written by Autodesk, Inc., and are
# protected by Federal copyright law. They may not be disclosed to third
# parties or copied or duplicated in any form, in whole or in part, without
# the prior written consent of Autodesk, Inc.
@mottosso
mottosso / README.md
Last active October 31, 2023 18:14
Hidden scriptJob with "virus" and "vaccine" keywords from CG Monastery

This is a scene file from the CG Monastery Discord chat user @roly, containing an embedded script that auto-installs and calls itself on SceneSave. The script was found in the rig bat_rig_04.mb, rather than the animation file, TURN_ani_bat_23.ma. Find the imported scene file below (5340 kb).

What happens?

  • Installs itself on scene-open, as a cmds.scriptJob
  • Installs itself on Maya open, as ~/maya/scripts/vaccine.py
  • Warning on scene save with the following message
cmake_minimum_required(VERSION 2.8)
# include the project setting file
include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)
# specify project name
set(PROJECT_NAME ArrayData)
set(SOURCE_FILES
Sender.cpp
@mottosso
mottosso / ArrayPlug.cpp
Last active January 21, 2024 13:21
Maya API Example - Writing to an Array Plug
/*
An example of writing to an array plug
Description
-----------------------------------------------------------
There are two ways of achieving this
1. Based on input, dynamically generate plugs in an array
2. Based on a connected array output, write to that
@mottosso
mottosso / CMakeLists.txt
Last active August 29, 2020 11:13
MyData - How to use MPxData with Maya
cmake_minimum_required(VERSION 2.8)
# include the project setting file
include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)
# specify project name
set(PROJECT_NAME MyData)
set(SOURCE_FILES
Sender.cpp
@mottosso
mottosso / README.md
Last active March 14, 2021 20:17
Parallel Evaluation in Maya 2018+

An example of parallel evaluation in Maya 2018+

Scenes

  1. Independent hierarchies, with parent constraint

Usage

Files prefixed scene* generate nodes suitable for parallelism, profile* contain ways to measure performance. Each snippet of code is meant to be copy/pasted into the Script Editor and run.

@mottosso
mottosso / README.md
Last active January 9, 2020 06:40
Subprocess profiling
<table cellspacing="0" cellpadding="0" width="325" style="font-family:Arial;padding:20px">
<tbody style="color:rgb(151,153,155);font-size:13px;line-height:18px;letter-spacing:1px">
<tr>
<td>
<img width=50 src="https://user-images.githubusercontent.com/2152766/37761204-ef2d0f0c-2db0-11e8-8109-3a1ac2e08c99.png" class="CToWUd">
</td>
<td style="padding-top:10px">
<span style="text-transform:uppercase;color:rgb(0,163,173)">
MARCUS&nbsp;OTTOSSON
</span>