Skip to content

Instantly share code, notes, and snippets.

@maloninc
maloninc / README.md
Last active April 22, 2023 11:40
MOD: Akamai x UNIQLO T-Shirt

これは何?

こちらのTシャツに印字されているgolangのコードは、 そのままではコンパイルできないので、ChatGPTにもっともらしいコードに書き換えてもらった上で、Tシャツに印字できるように適切に改行を施したコードです。

動きはしますが、残念ながら意味のある動作を実現できていません。

実行方法

@maloninc
maloninc / app.js
Last active November 26, 2022 08:53
Indexed DB with Promise
import DB from './indexed_db.js'
document.addEventListener('DOMContentLoaded', async () => {
const db = await DB.connect('SampleDB', 1, 'sample_table', 'id')
const saved = await DB.put(db, {id: '000', text: 'Hello, World', date: (new Date()).toISOString() })
console.log('Saved data', saved)
const result = await DB.get(db, '000')
console.log('result', result)
})
@maloninc
maloninc / create_self_signed_root_ca_signed_cert.rb
Created March 9, 2018 06:55
Ruby: Create localhost SSL/TLS certificate accepted by modern browsers
#
# Modern browsers don't accept self-signed localhost certificates.
# So you have to create CA's certificate and key before creating localhost certificate.
# I wrote a ruby method to do thease all tasks.
#
def create_self_signed_root_ca_signed_cert(bits, cn, comment)
year = 100
ca = OpenSSL::X509::Name.new
ca.add_entry 'CN', 'localhost CA'
@maloninc
maloninc / open-slide-show-record.js
Created March 4, 2018 06:05
Open slide show record on kintone
(function(){
document.body.addEventListener('DOMNodeInserted', function(event){
if(event.target.className == 'slideshow-cybozu'){
var slideshow = event.target;
slideshow.addEventListener('DOMNodeInserted', function(event){
if(event.target.tagName == 'IMG'){
var img = event.target;
if(img.parentElement.className.includes('slide-image-cybozu')){
img.style.cursor = 'pointer';
img.onclick = function(){