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 random | |
import string | |
def main(): | |
digit = 8 | |
for i in range(10): | |
random_str = ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(digit)]) | |
with open('out/{}.txt'.format(random_str), 'w') as f: | |
f.write('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
import random | |
import string | |
def main(): | |
digit = 8 | |
for i in range(10): | |
source = string.ascii_letters + string.digits | |
random_str = ''.join([random.choice(source) for _ in range(digit)]) | |
with open('out/{}.txt'.format(random_str), 'w') as f: |
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
function run(input, parameters) { | |
var sys = Application("System Events"); | |
var user_name = sys.currentUser().name(); | |
return input.toString().replace("/Users/" + user_name, "~"); | |
} |
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
/* <system section="theme" selected="8454420450068575461"> */ | |
@import url("http://hatenablog.com/theme/8454420450068575461.css"); | |
/* </system> */ | |
/* 表設定 */ | |
tbody tr:nth-child(even) { background-color:#fafafa; } | |
tbody tr:nth-child(odd) { background-color:#ffffff; } | |
/* はてなスターツールチップ設定 */ | |
.star-navigation-tooltip{ display: none; } |
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
function run(input, parameters) { | |
String.prototype.getLengthByte = function () { | |
var self = this, | |
count = 0, | |
char, | |
i; | |
for (i = 0; i < self.length; i++) { | |
char = self.charCodeAt(i); | |
if ((char >= 0x0 && char < 0x81) || (char == 0xf8f0) || | |
(char >= 0xff61 && char < 0xffa0) || (char >= 0xf8f1 && char < 0xf8f4)) { |
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
(function () { | |
if (app.documents.length > 0) { | |
var selected = app.activeDocument.selection, | |
i, | |
magnification = 2; | |
for (i = 0; i < selected.length; i++) { | |
selected[i].strokeWidth *= magnification; | |
} | |
} | |
})(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Hide secondary display</title> | |
<meta charset="utf-8"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style type="text/css"> |
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
function mkdirp(path) { | |
var fullPath = ""; | |
path = path.toString(); | |
var arr = path.split("/"); | |
for (var i = 0; i < arr.length; i++) { | |
var folderName = arr[i]; | |
fullPath += folderName + "/"; | |
var folder = new Folder(fullPath); | |
if (!folder.exists) folder.create(); | |
} |
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
if not hou.node('/obj/WORK'): | |
geo = hou.node('/obj/').createNode('geo', 'WORK') | |
geo.moveToGoodPosition() | |
for n in geo.children(): | |
n.destroy() |
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
selectedNode = hou.selectedNodes() | |
if len(selectedNode) is not 0: | |
for node in selectedNode: | |
transformNode = node.parent().createNode('xform', 'tf_touch_down') | |
hou.node(transformNode.path()).setInput(0, hou.node(node.path())) | |
transformNode.moveToGoodPosition() | |
transformNode.parm('ty').setExpression( | |
'-$YMIN', language=hou.exprLanguage.Hscript) |
OlderNewer