This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import shutil | |
from pathlib import Path | |
from datetime import datetime | |
from typing import Optional | |
LOCAL_PIC_DIR = Path('path to local') | |
NAS_PIC_DIR = Path('path to nas') | |
LOCAL_MOV_DIR = Path('path to local') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
from flask import jsonify | |
from celery import Celery | |
app = Flask(__name__) | |
app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' | |
app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' | |
SLACK_BOT_TOKEN = 'token' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from maya.api.OpenMaya import MGlobal | |
from mhash import MHash | |
selection_list = MGlobal.getSelectionListByName('persp') | |
# MObject は直接 dict のキーにできないけど | |
mobject = selection_list.getDependNode(0) | |
# MHashのインスタンスなら dict のキーにできる | |
mhash1 = MHash(mobject) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5StickC.h> | |
#include <Wire.h> | |
#include "DHT12.h" | |
DHT12 dht12; | |
int PIN = 32; // GROVEの黄色い線にパルスを送る | |
int PWMCH = 0; | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('hello') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import izip | |
from datetime import datetime | |
from maya import cmds | |
def slow_version(uvs): | |
a = ['meshName.uvst[0].uvsp[*]'] | |
a_append = a.append | |
for u, v in izip(uvs[0], uvs[1]): | |
a_append(u) | |
a_append(v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Make sure we’re running with root permissions. | |
if [ `whoami` != root ]; then | |
echo Please run this script using sudo | |
echo Just type “sudo !!” | |
exit | |
fi | |
#Check for 64-bit arch | |
if [uname -m != x86_64]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _layerList = [], | |
main = function() { | |
var document = activeDocument; | |
var layerList = document.layers; | |
getLayer(layerList); | |
var hasFeather = []; | |
for(var i = 0, num = _layerList.length; i < num; i++){ | |
var layer = _layerList[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_list = cmds.ls() | |
print(node_list) | |
# Result: 9044 | |
start = datetime.datetime.now() | |
for i in xrange(100): | |
shading_engine = cmds.ls(type='shadingEngine') | |
if not shading_engine: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import random | |
import math | |
import cv2 | |
from PIL import Image | |
def detect_markers(im): | |
markers = [] | |
# 輪郭線抽出のための二値化 | |
im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) |
NewerOlder