Skip to content

Instantly share code, notes, and snippets.

View Jessidhia's full-sized avatar

Jessica Franco Jessidhia

  • @pixiv Inc, pixiv desktop
  • Tokyo, Japan
View GitHub Profile
@Jessidhia
Jessidhia / gist:5373607
Created April 12, 2013 17:19
Musicbrainz Picard tagging script
$set(date,%originaldate%)
$if(%albumsort%,,$set(albumsort,%album%)))
$set(albumsort,$if(%catalognumber%,%catalognumber% ,)%albumsort%)
$set(albumsort,$if(%originaldate%,%originaldate% ,)%albumsort%)
$unset(compilation)
#! /usr/bin/env perl
use v5.14;
use strict;
use warnings;
use List::Util qw{first};
sub read_line {
my $line = scalar <>;
return () unless $line;
#! /usr/bin/env perl
use v5.14;
use strict;
use warnings;
use List::Util qw{first sum};
use IO::Handle;
sub debug(@) {
return unless $ENV{DEBUG};
@Jessidhia
Jessidhia / 0001-Make-fontconfig-less-dumb-on-windows.patch
Last active December 20, 2015 01:29
[PATCH] Make fontconfig-2.11.0 less dumb on windows
From 771818fab860a6e897f4046d67d8fd9949662977 Mon Sep 17 00:00:00 2001
From: "Diogo Franco (Kovensky)" <diogomfranco@gmail.com>
Date: Sat, 25 Jan 2014 18:04:20 -0300
Subject: [PATCH] Make fontconfig-2.11.0 less dumb on windows
Yes, fontconfig's indentation is that weird.
Adds the windows font directory to the default search path, stores
fontconfig cache files in a folder in the local application data folder.
This behaves correctly with roaming profiles and doesn't litter the
#include <iostream>
#include <chrono>
#include <thread>
#include <cmath>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <xinput.h>
@Jessidhia
Jessidhia / AutoHotkey.ahk
Last active January 21, 2020 07:19
Script to enable JIS keys on Windows Dvorak layout
#SingleInstance force
#InstallKeybdHook
#UseHook On
; HACK: KBDDV.DLL doesn't deal with the IME keys, so map them by scancode
; Yen key: 07d, assign to \ :(
; Backslash key: 073, assign to `
; Hankaku/Zenkaku key: working as tilde key, don't touch
; Muhenkan: 07B, disable IME
; Henkan: 079, enable IME
@Jessidhia
Jessidhia / zsh-history-search-with-peco.zsh
Last active April 29, 2016 05:17 — forked from jimeh/zsh-history-search-with-peco.zsh
Use peco (https://github.com/peco/peco) to search ZSH's history via ctrl+R
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if [ "$(which peco &>/dev/null && echo 'a' | peco --select-1)" = 'a' ]; then
function peco_select_history() {
local lbuf="$LBUFFER"
BUFFER=
zle -c -U "$(print -rl - $history | peco --layout=bottom-up --query "$lbuf")"
}
zle -N peco_select_history
bindkey '^R' peco_select_history
import $ from 'jquery'
// jQuery Deferreds don't have a prototype, so patching them is more complicated
// than the native Promises.
const origDeferred = $.Deferred
const sym = module.hot && module.hot.data
? module.hot.data
: Symbol('deferred-finally')
import React from 'react'
import classNames from 'classnames'
// I am trying to write a React version of an internal library's component.
// They share the CSS and class names, so the internal library's jquery event handler will capture clicks,
// thus I have to use a ref and attach handlers directly to it.
class Test extends React.Component {
constructor (props) {
super(props)
@Jessidhia
Jessidhia / code.sh
Created June 30, 2016 05:27
VS Code's launch script modified to work when called from inside Cygwin
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
NAME="Code"
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
ELECTRON="$VSCODE_PATH/$NAME.exe"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
if [ "$OSTYPE" = "cygwin" ] && which cygpath &>/dev/null; then