Skip to content

Instantly share code, notes, and snippets.

View w00kie's full-sized avatar
🙄
( -_・)σ - - - - - - - - ・

François Rejeté w00kie

🙄
( -_・)σ - - - - - - - - ・
View GitHub Profile
@w00kie
w00kie / index.ts
Last active March 14, 2025 02:34
Cloudflare Worker that bundles R2 objects in a Zip file
import { z } from 'zod';
import { ZipWriter, BlobReader, configure } from '@zip.js/zip.js';
// Without this, we get uncaught error due to Workers runtime bug
// See: https://github.com/gildas-lormeau/zip.js/discussions/514
configure({
useCompressionStream: false,
});
// Payload schema that lists the files to be bundled, their filenames and the archive filename
@w00kie
w00kie / deploy-pages.yml
Created June 12, 2024 03:30
Tweaked GitHub actions workflow to deploy Vite pages with Bun
# Workflow to deploy Vite apps to Github Pages with Bun
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Keybase proof

I hereby claim:

  • I am w00kie on github.
  • I am frejete (https://keybase.io/frejete) on keybase.
  • I have a public key whose fingerprint is E202 76C0 F466 44EC 7D95 7D2A 8EF7 523D 0CB9 BFA4

To claim this, I am signing this object:

@w00kie
w00kie / gist:9ba51eb2622f7caaa632
Created October 6, 2014 00:54
Merge subtitles into MKV
mkvmerge -o output.mkv input.mkv subs.srt
mkvmerge -o output.mkv input.mkv --language 0:ger --track-name 0:German subs.srt
@w00kie
w00kie / gist:5b19d740c4757ac1139e
Created October 1, 2014 06:13
SSL error on Paymium API with Python requests
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('https://paymium.com/api/v1/data/eur/ticker')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vagrant/.virtualenvs/btcfxrate/local/lib/python2.7/site-packages/requests/api.py", line 59, in get
return request('get', url, **kwargs)
File "/home/vagrant/.virtualenvs/btcfxrate/local/lib/python2.7/site-packages/requests/api.py", line 48, in request
<?php
/**
* WP Redix Index
*
* Redis caching system for WordPress. Inspired by Jim Westergren.
*
* @author Jeedo Aquino
* @see http://www.jeedo.net/lightning-fast-wordpress-with-nginx-redis/
* @see http://www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
*/
@w00kie
w00kie / gist:5551971
Last active December 17, 2015 04:39
Binary safe copyFile for muffin.js
# Use Piping Streams to copy files
copyFile = (source, target) ->
deffered = Q.defer()
muffin.mkdir_p path.dirname(target), 0o755, (err) ->
return done(err) if err
# Start Read Stream
rd = fs.createReadStream source
rd.on 'error', (err) ->
done err
# Some stupid code that will issue an error
foo = 2
derp = foo*2 + bar
console.debug "Should have been an error right there."
@w00kie
w00kie / kana_to_romaji.py
Created August 17, 2012 09:46 — forked from osima/kana_to_romaji.py
convert from kana(hiragana japanese character) to romaji using python
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
def kana_to_romaji(text):
dict={
u'きゃ':'kya',u'きゅ':'kyu',u'きょ':'kyo',
u'しゃ':'sha',u'しゅ':'shu',u'しょ':'sho',
@w00kie
w00kie / new_bashrc.sh
Created August 12, 2012 14:25 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?