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 / crawl.py
Created November 30, 2013 09:52
Crawl webpage to restore success records , calculate today's WCG points and list every host's points.
#!/usr/bin/python
# -*- coding:utf-8 -*-
from datetime import datetime
import sqlite3
import cookielib
import requests
from BeautifulSoup import *
device_final_score_url = "https://secure.worldcommunitygrid.org/ms/viewBoincResults.do?filterDevice=0&filterStatus=4&projectId=-1&pageNum=%s&sortBy=returnedTime"
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import urllib
import urllib2
from BeautifulSoup import *
SAVE_PATH = "/Users/jeswang/Desktop/ICONS/"
@Jeswang
Jeswang / break.c
Created October 30, 2012 00:07
Using bytes in Python.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <iostream>
#include <string>
//
// UIView+CommonDrawing.h
// Contacts Plus
//
// Created by Tony Arnold on 4/08/10.
// Copyright 2010 The CocoaBots. All rights reserved.
//
#import <Foundation/Foundation.h>
@Jeswang
Jeswang / gist:2372560
Created April 13, 2012 01:16 — forked from yiquncode/gist:760976
Git代码同步
#线上
#获取代码
git clone ...
#获取更新
git pull
#如果在线上修改了代码,要推回
git push
#线上代码和git版本库冲突
#Your local changes to ... would be overwritten by merge
git fetch --all