Skip to content

Instantly share code, notes, and snippets.

@mnmly
mnmly / README.md
Last active January 4, 2016 06:39
node-canvas + opentype.js demo.

node-canvas + opentype.js demo.

bold.png

regular.png

#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(255);
ofEnableSmoothing();
layoutPoints();
}
@mnmly
mnmly / prefix.js
Created October 28, 2014 15:49
dumb prefix
var p = document.createElement('p');
var prefixes = ['webkit','Moz','ms','O'];
var len = prefixes.length;
var style = p.style;
p = null;
module.exports = prefix;
function prefix(prop) {
for (i = 0; i < len; i++) {
var fs = require( 'fs' )
var struggle = fs.readFileSync( __dirname + '/struggle.txt', 'utf-8' )
console.log( mirror(struggle, 45, true ) );
console.log( '--------------------' );
console.log( mirror(struggle, 90, false ) );
function mirror( str, gap, keep ) {
var lines = str.split( '\n' )
@mnmly
mnmly / install-yak-for-mac.sh
Created September 9, 2019 09:15
Install Grasshopper Package Manager yak on mac
cd /Applications/Rhinoceros.app/Contents/Frameworks/RhCore.framework/Versions/A/Resources
mkbundle --simple -o yak yak.exe
ln -s /Applications/Rhinoceros.app/Contents/Frameworks/RhCore.framework/Versions/A/Resources/yak /usr/local/bin/yak
@mnmly
mnmly / convert-tile
Created November 25, 2020 19:16
convert-tile
#!/usr/bin/env bash
dir="$(dirname "$1")"
base=$(basename "$1" | cut -d. -f1)
out="$dir/$base-%d03.jpg"
convert "$1" -crop 2x2@ +repage +adjoin "$out"
@mnmly
mnmly / index.py
Created December 28, 2020 20:37
ghtree` #python #gh
import ghpythonlib.treehelpers as th
x = th.tree_to_list(x)
layerTree = th.list_to_tree(layerTree, source=[0,0])
@mnmly
mnmly / proxy.pac
Last active October 20, 2021 16:09
function FindProxyForURL(url, host) {
PROXY = "PROXY 127.0.0.1:1234";
alert(url);
if (shExpMatch(host, "*.alp-official.jp") ) {
// if ( shExpMatch(url, "*/js/*") ) {
return PROXY;
// }
@mnmly
mnmly / keyframe-iterations.py
Last active March 24, 2022 06:22
make iterations into keyframes #blender #bpy
import re
import bpy
iteration_items = []
for item in bpy.data.objects:
if 'Block__Iteration' in item.name_full:
iteration_items.append(item)
prev_name = None
frame_index = -1
for j in range(50):
@mnmly
mnmly / dump.js
Created July 28, 2022 09:08
notion's api
const { Client } = require("@notionhq/client")
const fs = require('fs')
const path = require( 'path' )
const parse = require('url').parse
const request = require( 'request' )
// Initializing a client
const download = (uri, filename, callback) => {
request.head(uri, (err, res, body) => {
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);