Skip to content

Instantly share code, notes, and snippets.

@Jeswang
Jeswang / import_and_export_alphatab.js
Created August 9, 2023 15:41
import_and_export_alphatab.js
const alphaTab = require("@coderline/alphatab");
const fs = require("fs");
const fileData = fs.readFileSync("sound-reproduce/accentuations-input.gp");
const settings = new alphaTab.Settings();
const score = alphaTab.importer.ScoreLoader.loadScoreFromBytes(
new Uint8Array(fileData),
settings
);
@Jeswang
Jeswang / test.c
Last active February 18, 2020 00:30
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <stdint.h>
#include <ucontext.h>
#include <sys/cdefs.h>
#include <sys/param.h>
#!/usr/bin/ruby
# encoding: utf-8
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
#
# replaces alignleft and alignright classes with appropriate style attribute
#!/usr/bin/ruby
# encoding: utf-8
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
#
# replaces alignleft and alignright classes with appropriate style attribute
#!/usr/bin/ruby
# encoding: utf-8
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
#
# replaces alignleft and alignright classes with appropriate style attribute
@Jeswang
Jeswang / typo.css
Created January 31, 2015 13:43
Refine sofish/typo.css for Marked.app
@charset "utf-8";
/* 防止用户自定义背景颜色对网页的影响,添加让用户可以自定义字体 */
html{
color:#333;
background:#fff;
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%;
text-rendering:optimizelegibility;
-moz-osx-font-smoothing: grayscale;
@Jeswang
Jeswang / same.cpp
Last active August 29, 2015 14:12
find same ints in two file
#include <iostream>
#include <fstream>
#include <bitset>
#include <queue>
#include <vector>
#include <functional>
using namespace std;
bitset<4294967296> bits;
priority_queue<int, vector<int>, greater<int> > res;
@Jeswang
Jeswang / halfPNG.sh
Last active August 29, 2015 14:11
Transform images
function halfPNGs(){
dir=$1
n=0
while read f
do
# Image name
i=$(basename "$f")
echo $i
if [[ $i == *\@2x\.png ]]; then
# Height of image
@Jeswang
Jeswang / generateSoftLinkForPath.py
Last active August 29, 2015 14:07
Fix soft links for the zip file downloaded from https://github.com/phracker/MacOSX-SDKs
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Jeswang<wangyi724@gmail.com>
# http://blog.jeswang.org
# Created on 2014-10-22 13:03:12
import os
def file_exists(filename):
try:
@Jeswang
Jeswang / B.py
Created August 19, 2014 12:09 — forked from robert-king/B.py
from gcj_context import in_out, test_in_out
def solve_test_case(data):
stuff = next(data)
return "my_answer_from_stuff"
def main():
#with test_in_out() as (in_file, out_file):