Skip to content

Instantly share code, notes, and snippets.

@sungho1114
sungho1114 / gist:c784d80d318f3be728b56900a160fd89
Created July 22, 2020 23:10
Maya Easy Mesh OBJ/FBX Exporter
# move selected mesh into the middle, export as fbx or obj, and bring it back to original location
from maya import cmds
import pymel.core as pm
pm.loadPlugin("fbxmaya") # LOAD PLUGIN
#UI Function
def main():
#before adding window
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 26, 2024 04:52
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@mertenvg
mertenvg / polyfill.bind.js
Last active April 26, 2024 04:52
Function bind(obj[, arg1[, arg2[, ...]]]) polyfill
if (typeof Function.prototype.bind === 'undefined') {
/**
* Function bind(obj[, arg1[, arg2[, ...]]]) polyfill
*
* @param obj
*
* @returns {Function}
*/
Function.prototype.bind = function (obj) {
var fn = this,
@zubair1
zubair1 / gist:5096779
Created March 6, 2013 04:45
Map db fields to obj properties
public static function instantiate($resultArray)
{
if (!isset($resultArray['usergroup']) || empty($resultArray['usergroup']))
{
trigger_error('The usergroup cannnot be confirmed while instantiating.', E_USER_ERROR);
return false;
}
// Instantiate based on Usergroup
switch ($resultArray['usergroup'])
@hax
hax / iterator-with-message.md
Last active April 26, 2024 04:51
An idea from combination of `[...rest, last]` syntax, reverse iterator and `function.sent`
@blizzrdof77
blizzrdof77 / zha-moes-zigbee-rotary-smart-knob-remote-control.yaml
Last active April 26, 2024 04:50
ZHA - Moes Tuya Smart Knob (TS004F) controller for remote control devices
blueprint:
name: ZHA - Moes Tuya Smart Knob (TS004F) controller for remote control devices
description: Control remotes (e.g. volume up/down) with a Moes Tuya smart knob (the spinny ones). You can set functions for single press, rotating left, and rotating right.
domain: automation
source_url: https://gist.github.com/blizzrdof77/c30c388ca5f4ce7ed72752296767417d
input:
remote:
name: Smart Knob Device
description: Moes Tuya Smart Knob Device to use
selector:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<div class="controls">
<div class="left">
<div id="playButton" class="button">
@Sh4yy
Sh4yy / clx.go
Created April 25, 2024 20:39
Generate CLI commands for common tasks.
package main
import (
"context"
"errors"
"fmt"
"io"
"log"
"os"
"runtime"
@banaslee
banaslee / XGH - en.txt
Last active April 26, 2024 04:50
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).
@hax
hax / channel.js
Created May 13, 2020 15:12
A experimental Channel in JS
// kotlin channel: https://kotlinlang.org/docs/reference/coroutines/channels.html
// golang channel
class Channel {
constructor() {
this._s = null
this._r = null
}
send(v) {
if (this._r) {