Skip to content

Instantly share code, notes, and snippets.

@David-Bates
David-Bates / jump_frames.py
Created March 25, 2018 02:30
Blender addon which adds a button to the timeline to jump through time.
bl_info = {
"name": "Jump Frames",
"author": "David ♦",
"version": (1, 0),
"blender": (2, 75, 0),
"location": "Timeline header > Jump Frames",
"description": "Very simple jump N frames foward or back.",
"warning": "",
"wiki_url": "",
"category": "Animation",
@David-Bates
David-Bates / default material.py
Created January 31, 2018 18:04
modal version of the default material switcher. This one has a ui button
import bpy
from bpy.props import BoolProperty
class SeqModalTimerOperator(bpy.types.Operator):
"""Operator which runs its self from a timer"""
bl_idname = "wm.modal_timer_operator"
bl_label = "Default Material Timer Operator"
_timer = None
mat_count = len(bpy.data.materials)
@David-Bates
David-Bates / AIO wiki album infobox small art
Created October 8, 2016 12:33
This is the readible (un-minified) version of the album infobox small album art section.
<div class="hiddenStructure
{{#ifexist:
{{#vardefineecho:filePath|
File:{{#sub:{{BASEPAGENAME}}|6|2}}-front-small.jpg
}}
| true
{{#vardefine:shortName|
{{#explode:{{BASEPAGENAME}}|:|0}}
}}
{{#vardefineecho:SfilePath|
@David-Bates
David-Bates / Sportmanship badge
Created July 13, 2015 17:46
SE data explorer: Sportmanship badge
SELECT DISTINCT OtherAnswers.OwnerUserId AS [User Link],
OtherAnswers.Id AS [Post Link]
FROM Posts YourAnswers
JOIN Posts Questions ON YourAnswers.ParentId = Questions.Id
AND Questions.AnswerCount > 1
Join Posts OtherAnswers ON OtherAnswers.ParentId = Questions.Id
AND OtherAnswers.OwnerUserId != ##YourId:int##
WHERE YourAnswers.OwnerUserId = ##YourId:int##
AND YourAnswers.Score > 0
@David-Bates
David-Bates / gifs
Created July 13, 2015 17:38
SE data explorer: Who uses the most gifs
/*select Id as [Post Link]
from Posts
where PostTypeId = 2 and OwnerUserId = 599 and Body like '%.gif%'*/
/*select OwnerUserId as [User Link], count(OwnerUserId) as count
from Posts
where PostTypeId = 2 and Body like '%.gif%'
group by OwnerUserId
order by count desc*/
@David-Bates
David-Bates / highest rated comments
Created July 13, 2015 17:05
SE data explorer: My highest rated comments
DECLARE @UserId int = ##UserId##
SELECT TOP 100
PostId AS [Post Link],
Score
FROM
Comments
WHERE
UserId = @UserId