Skip to content

Instantly share code, notes, and snippets.

@tripodsan
tripodsan / bulk1.ply
Created January 16, 2023 13:48
PLY version of second bulk of https://www.spoj.com/problems/BULK/ (w/o the bottom face)
ply
format ascii 1.0
element vertex 52
property float x
property float y
property float z
element face 12
property list uchar int vertex_indices
end_header
20 20 30
@tripodsan
tripodsan / bulk0.ply
Created January 16, 2023 13:46
PLY version of first bulk of https://www.spoj.com/problems/BULK/ (w/o the bottom face)
ply
format ascii 1.0
element vertex 49
property float x
property float y
property float z
element face 12
property list uchar int vertex_indices
property uchar alpha
end_header

Hello

space

space

space

space

#! /usr/bin/env python
#
# Example program using irc.client.
#
# This program is free without restrictions; do anything you like with
# it.
#
# Joel Rosdahl <joel@rosdahl.net>
import irc.client
@tripodsan
tripodsan / transaction_id.md
Created March 27, 2020 02:52
Adobe I/O Runtime Transaction ID behaviour

Transaction ID behaviour.

see ./transaction.js:

function main(params) {
  const { __ow_headers: headers = {} } = params;
  const body = {
    transactionId: process.env.__OW_TRANSACTION_ID,
    requestId: headers['x-request-id'] || 'n/a',
$ npm install
installing..
....

$ cd foobar
$ cat readme.md | wd
1 3 4 5
@tripodsan
tripodsan / test.js
Created January 27, 2020 01:53
generators and promise all
async function invokePing(ow, cnt) {
log.info(`${cnt}: invoking delayed_ping`);
const result = await ow.actions.invoke({
blocking: true,
name: 'delayed_ping',
result: true,
});
log.info(`${cnt}: done.`);
return result;
}
@tripodsan
tripodsan / cls-test.js
Last active November 21, 2019 01:34
Simple test to verify the usage of cls-hooked
/*
* Copyright 2019 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
  1. test
    on 2 lines.
  2. foo bar
  3. test
@tripodsan
tripodsan / getContents.md
Created April 24, 2019 07:40
wrong github getcontents

first I create a file with unicode characters. my terminal is set to utf8, so it stores it as such:

$ echo "日本" > utf8-test.txt
$ cat utf8-test.txt
日本
$ file utf8-test.txt
utf8-test.txt: UTF-8 Unicode text